1. 31 Jul, 2020 12 commits
    • Guo Ren's avatar
      csky: Add arch_show_interrupts for IPI interrupts · e6169c4b
      Guo Ren authored
      Here is the result:
      
       cat /proc/interrupts
                 CPU0       CPU1       CPU2       CPU3
       15:       1348       1299        952       1076  C-SKY SMP Intc  15  IPI Interrupt
       16:       1203       1825       1598       1307  C-SKY SMP Intc  16  csky_mp_timer
       43:        292          0          0          0  C-SKY SMP Intc  43  ttyS0
       57:        106          0          0          0  C-SKY SMP Intc  57  virtio0
      IPI0:         0          0          0          0  Empty interrupts
      IPI1:        19         41         45         27  Rescheduling interrupts
      IPI2:      1330       1259        908       1050  Function call interrupts
      IPI3:         0          0          0          0  Irq work interrupts
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      e6169c4b
    • Guo Ren's avatar
      csky: Add irq_work support · 2c81b076
      Guo Ren authored
      Running work in hardware interrupt context for csky. Implement:
       - arch_irq_work_raise()
       - arch_irq_work_has_interrupt()
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      2c81b076
    • Guo Ren's avatar
      csky: Fixup warning by EXPORT_SYMBOL(kmap) · 667b9324
      Guo Ren authored
      This a wrong code, and no kmap symbol for export.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      667b9324
    • Guo Ren's avatar
      csky: Set CONFIG_NR_CPU 4 as default · 50d23a1c
      Guo Ren authored
      The C860 processors support 4 cores smp for maximum, so set NR_CPU
      to 4 as default
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      50d23a1c
    • Guo Ren's avatar
      csky: Use top-down mmap layout · 953131e5
      Guo Ren authored
      Follow riscv mmap layout with commit "riscv: make mmap allocation
      top-down by default (54c95a11)".
      
      Before:
       cat /proc/self/maps
      00008000-000dc000 r-xp 00000000 fe:00 17         /bin/busybox
      000dc000-000dd000 r--p 000d3000 fe:00 17         /bin/busybox
      000dd000-000de000 rw-p 000d4000 fe:00 17         /bin/busybox
      2aaa8000-2aac6000 r-xp 00000000 fe:00 196        /lib/ld-2.28.9000.so
      2aac6000-2aac7000 r-xp 00000000 00:00 0          [vdso]
      2aac7000-2aac8000 r--p 0001e000 fe:00 196        /lib/ld-2.28.9000.so
      2aac8000-2aac9000 rw-p 0001f000 fe:00 196        /lib/ld-2.28.9000.so
      2aac9000-2aad9000 r-xp 00000000 fe:00 219        /lib/libresolv-2.28.9000.so
      2aad9000-2aada000 r--p 0000f000 fe:00 219        /lib/libresolv-2.28.9000.so
      2aada000-2aadb000 rw-p 00010000 fe:00 219        /lib/libresolv-2.28.9000.so
      2aadb000-2aadd000 rw-p 00000000 00:00 0
      2aadd000-2ac27000 r-xp 00000000 fe:00 203        /lib/libc-2.28.9000.so
      2ac27000-2ac28000 ---p 0014a000 fe:00 203        /lib/libc-2.28.9000.so
      2ac28000-2ac2a000 r--p 0014a000 fe:00 203        /lib/libc-2.28.9000.so
      2ac2a000-2ac2b000 rw-p 0014c000 fe:00 203        /lib/libc-2.28.9000.so
      2ac2b000-2ac2e000 rw-p 00000000 00:00 0
      7fb99000-7fbba000 rwxp 00000000 00:00 0          [stack]
      
      After:
       cat /proc/self/maps
      00008000-000dc000 r-xp 00000000 fe:00 17         /bin/busybox
      000dc000-000dd000 r--p 000d3000 fe:00 17         /bin/busybox
      000dd000-000de000 rw-p 000d4000 fe:00 17         /bin/busybox
      77e13000-77f5d000 r-xp 00000000 fe:00 203        /lib/libc-2.28.9000.so
      77f5d000-77f5e000 ---p 0014a000 fe:00 203        /lib/libc-2.28.9000.so
      77f5e000-77f60000 r--p 0014a000 fe:00 203        /lib/libc-2.28.9000.so
      77f60000-77f61000 rw-p 0014c000 fe:00 203        /lib/libc-2.28.9000.so
      77f61000-77f66000 rw-p 00000000 00:00 0
      77f66000-77f76000 r-xp 00000000 fe:00 219        /lib/libresolv-2.28.9000.so
      77f76000-77f77000 r--p 0000f000 fe:00 219        /lib/libresolv-2.28.9000.so
      77f77000-77f78000 rw-p 00010000 fe:00 219        /lib/libresolv-2.28.9000.so
      77f78000-77f96000 r-xp 00000000 fe:00 196        /lib/ld-2.28.9000.so
      77f96000-77f97000 r-xp 00000000 00:00 0          [vdso]
      77f97000-77f98000 r--p 0001e000 fe:00 196        /lib/ld-2.28.9000.so
      77f98000-77f99000 rw-p 0001f000 fe:00 196        /lib/ld-2.28.9000.so
      7fd7b000-7fd9c000 rwxp 00000000 00:00 0          [stack]
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      953131e5
    • Guo Ren's avatar
      csky: Optimize the trap processing flow · 5bc46ce2
      Guo Ren authored
       - Seperate different trap functions
       - Add trap_no()
       - Remove panic code print
       - Redesign die_if_kerenl to die with riscv's
       - Print exact trap info for app segment fault
      
      [   17.389321] gzip[126]: unhandled signal 11 code 0x3 at 0x0007835a in busybox[8000+d4000]
      [   17.393882]
      [   17.393882] CURRENT PROCESS:
      [   17.393882]
      [   17.394309] COMM=gzip PID=126
      [   17.394513] TEXT=00008000-000db2e4 DATA=000dcf14-000dd1ad BSS=000dd1ad-000ff000
      [   17.395499] USER-STACK=7f888e50  KERNEL-STACK=bf130300
      [   17.395499]
      [   17.396801] PC: 0x0007835a (0x7835a)
      [   17.397048] LR: 0x000058b4 (0x58b4)
      [   17.397285] SP: 0xbe519f68
      [   17.397555] orig_a0: 0x00002852
      [   17.397886] PSR: 0x00020341
      [   17.398356]  a0: 0x00002852   a1: 0x000f2f5a   a2: 0x0000d7ae   a3: 0x0000005d
      [   17.399289]  r4: 0x000de150   r5: 0x00000002   r6: 0x00000102   r7: 0x00007efa
      [   17.399800]  r8: 0x7f888bc4   r9: 0x00000001  r10: 0x000002eb  r11: 0x0000aac1
      [   17.400166] r12: 0x00002ef2  r13: 0x00000007  r15: 0x000058b4
      [   17.400531] r16: 0x0000004c  r17: 0x00000031  r18: 0x000f5816  r19: 0x000e8068
      [   17.401006] r20: 0x000f5818  r21: 0x000e8068  r22: 0x000f5918  r23: 0x90000000
      [   17.401721] r24: 0x00000031  r25: 0x000000c8  r26: 0x00000000  r27: 0x00000000
      [   17.402199] r28: 0x2ac2a000  r29: 0x00000000  r30: 0x00000000  tls: 0x2aadbaa8
      [   17.402686]  hi: 0x00120340   lo: 0x7f888bec
      /etc/init.ci/ntfs3g_run: line 61:   126 Segmentation fault      gzip -c -9 /mnt/test.bin > /mnt/test_bin.gz
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      5bc46ce2
    • Guo Ren's avatar
      csky: Add support for function error injection · 71e193d7
      Guo Ren authored
      Inspired by the commit 42d038c4 ("arm64: Add support for function
      error injection"), this patch supports function error injection for
      csky.
      
      This patch mainly support two functions: one is regs_set_return_value()
      which is used to overwrite the return value; the another function is
      override_function_with_return() which is to override the probed
      function returning and jump to its caller.
      
      Test log:
      
       cd /sys/kernel/debug/fail_function/
       echo sys_clone > inject
       echo 100 > probability
       echo 1 > interval
       ls /
      [  108.644163] FAULT_INJECTION: forcing a failure.
      [  108.644163] name fail_function, interval 1, probability 100, space 0, times 1
      [  108.647799] CPU: 0 PID: 104 Comm: sh Not tainted 5.8.0-rc5+ #46
      [  108.648384] Call Trace:
      [  108.649339] [<8005eed4>] walk_stackframe+0x0/0xf0
      [  108.649679] [<8005f16a>] show_stack+0x32/0x5c
      [  108.649927] [<8040f9d2>] dump_stack+0x6e/0x9c
      [  108.650271] [<80406f7e>] should_fail+0x15e/0x1ac
      [  108.650720] [<80118ba8>] fei_kprobe_handler+0x28/0x5c
      [  108.651519] [<80754110>] kprobe_breakpoint_handler+0x144/0x1cc
      [  108.652289] [<8005d6da>] trap_c+0x8e/0x110
      [  108.652816] [<8005ce8c>] csky_trap+0x5c/0x70
      -sh: can't fork: Invalid argument
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      71e193d7
    • Guo Ren's avatar
      csky: Fixup kprobes handler couldn't change pc · a5447fb9
      Guo Ren authored
      The "Changing Execution Path" section in the Documentation/kprobes.txt
      said:
      
      Since kprobes can probe into a running kernel code, it can change the
      register set, including instruction pointer.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      a5447fb9
    • Guo Ren's avatar
      csky: Fixup duplicated restore sp in RESTORE_REGS_FTRACE · f788bb2f
      Guo Ren authored
      There is no user return for RESTORE_REGS_FTRACE, so it's no need to
      save sp into ss0 as RESTORE_REGS_ALL.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      f788bb2f
    • Guo Ren's avatar
      csky: Add cpu feature register hint for smp · 8077e66b
      Guo Ren authored
      CPU features registers are setup by customers' bootloader, but
      Linux must help transfer them from the primary to secondary cores.
      This patch add hint2 CPU feature register supported.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      8077e66b
    • Guo Ren's avatar
      csky: Add SECCOMP_FILTER supported · e95a4f8c
      Guo Ren authored
      secure_computing() is called first in syscall_trace_enter() so that
      a system call will be aborted quickly without doing succeeding syscall
      tracing if seccomp rules want to deny that system call.
      
      TODO:
       - Update https://github.com/seccomp/libseccomp csky support
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      e95a4f8c
    • Tobias Klauser's avatar
      csky: remove unusued thread_saved_pc and *_segments functions/macros · c23dd240
      Tobias Klauser authored
      These are used nowhere in the tree (except for some architectures which
      define them for their own use) and were already removed for other
      architectures in:
      
      commit 6474924e ("arch: remove unused macro/function thread_saved_pc()")
      commit c17c0204 ("arch: remove unused *_segments() macros/functions")
      
      Remove them from arch/csky as well.
      Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      c23dd240
  2. 26 Jul, 2020 9 commits
  3. 25 Jul, 2020 17 commits
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.8-rc7' of... · 04300d66
      Linus Torvalds authored
      Merge tag 'riscv-for-linus-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux into master
      
      Pull RISC-V fixes from Palmer Dabbelt:
       "A few more fixes this week:
      
         - A fix to avoid using SBI calls during kasan initialization, as the
           SBI calls themselves have not been probed yet.
      
         - Three fixes related to systems with multiple memory regions"
      
      * tag 'riscv-for-linus-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: Parse all memory blocks to remove unusable memory
        RISC-V: Do not rely on initrd_start/end computed during early dt parsing
        RISC-V: Set maximum number of mapped pages correctly
        riscv: kasan: use local_tlb_flush_all() to avoid uninitialized __sbi_rfence
      04300d66
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-07-25' of... · fbe0d451
      Linus Torvalds authored
      Merge tag 'x86-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master
      
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes:
      
         - Fix a section end page alignment assumption that was causing
           crashes
      
         - Fix ORC unwinding on freshly forked tasks which haven't executed
           yet and which have empty user task stacks
      
         - Fix the debug.exception-trace=1 sysctl dumping of user stacks,
           which was broken by recent maccess changes"
      
      * tag 'x86-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/dumpstack: Dump user space code correctly again
        x86/stacktrace: Fix reliable check for empty user task stacks
        x86/unwind/orc: Fix ORC for newly forked tasks
        x86, vmlinux.lds: Page-align end of ..page_aligned sections
      fbe0d451
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2020-07-25' of... · 78b1afe2
      Linus Torvalds authored
      Merge tag 'perf-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master
      
      Pull uprobe fix from Ingo Molnar:
       "Fix an interaction/regression between uprobes based shared library
        tracing & GDB"
      
      * tag 'perf-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        uprobes: Change handle_swbp() to send SIGTRAP with si_code=SI_KERNEL, to fix GDB regression
      78b1afe2
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2020-07-25' of... · a7b36c2b
      Linus Torvalds authored
      Merge tag 'timers-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master
      
      Pull timer fix from Ingo Molnar:
       "Fix a suspend/resume regression (crash) on TI AM3/AM4 SoC's"
      
      * tag 'timers-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clocksource/drivers/timer-ti-dm: Fix suspend and resume for am3 and am4
      a7b36c2b
    • Linus Torvalds's avatar
      Merge tag 'sched-urgent-2020-07-25' of... · 3077805e
      Linus Torvalds authored
      Merge tag 'sched-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master
      
      Pull scheduler fixes from Ingo Molnar:
       "Fix a race introduced by the recent loadavg race fix, plus add a debug
        check for a hard to debug case of bogus wakeup function flags"
      
      * tag 'sched-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched: Warn if garbage is passed to default_wake_function()
        sched: Fix race against ptrace_freeze_trace()
      3077805e
    • Linus Torvalds's avatar
      Merge tag 'efi-urgent-2020-07-25' of... · 17baa442
      Linus Torvalds authored
      Merge tag 'efi-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into master
      
      Pull EFI fixes from Ingo Molnar:
       "Various EFI fixes:
      
         - Fix the layering violation in the use of the EFI runtime services
           availability mask in users of the 'efivars' abstraction
      
         - Revert build fix for GCC v4.8 which is no longer supported
      
         - Clean up some x86 EFI stub details, some of which are borderline
           bugs that copy around garbage into padding fields - let's fix these
           out of caution.
      
         - Fix build issues while working on RISC-V support
      
         - Avoid --whole-archive when linking the stub on arm64"
      
      * tag 'efi-urgent-2020-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        efi: Revert "efi/x86: Fix build with gcc 4"
        efi/efivars: Expose RT service availability via efivars abstraction
        efi/libstub: Move the function prototypes to header file
        efi/libstub: Fix gcc error around __umoddi3 for 32 bit builds
        efi/libstub/arm64: link stub lib.a conditionally
        efi/x86: Only copy upto the end of setup_header
        efi/x86: Remove unused variables
      17baa442
    • Linus Torvalds's avatar
      Merge tag '5.8-rc6-cifs-fix' of git://git.samba.org/sfrench/cifs-2.6 into master · 7cb3a5c5
      Linus Torvalds authored
      Pull cifs fix from Steve French:
       "A fix for a recently discovered regression in rename to older servers
        caused by a recent patch"
      
      * tag '5.8-rc6-cifs-fix' of git://git.samba.org/sfrench/cifs-2.6:
        Revert "cifs: Fix the target file was deleted when rename failed."
      7cb3a5c5
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net into master · 1b64b2e2
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix RCU locaking in iwlwifi, from Johannes Berg.
      
       2) mt76 can access uninitialized NAPI struct, from Felix Fietkau.
      
       3) Fix race in updating pause settings in bnxt_en, from Vasundhara
          Volam.
      
       4) Propagate error return properly during unbind failures in ax88172a,
          from George Kennedy.
      
       5) Fix memleak in adf7242_probe, from Liu Jian.
      
       6) smc_drv_probe() can leak, from Wang Hai.
      
       7) Don't muck with the carrier state if register_netdevice() fails in
          the bonding driver, from Taehee Yoo.
      
       8) Fix memleak in dpaa_eth_probe, from Liu Jian.
      
       9) Need to check skb_put_padto() return value in hsr_fill_tag(), from
          Murali Karicheri.
      
      10) Don't lose ionic RSS hash settings across FW update, from Shannon
          Nelson.
      
      11) Fix clobbered SKB control block in act_ct, from Wen Xu.
      
      12) Missing newlink in "tx_timeout" sysfs output, from Xiongfeng Wang.
      
      13) IS_UDPLITE cleanup a long time ago, incorrectly handled
          transformations involving UDPLITE_RECV_CC. From Miaohe Lin.
      
      14) Unbalanced locking in netdevsim, from Taehee Yoo.
      
      15) Suppress false-positive error messages in qed driver, from Alexander
          Lobakin.
      
      16) Out of bounds read in ax25_connect and ax25_sendmsg, from Peilin Ye.
      
      17) Missing SKB release in cxgb4's uld_send(), from Navid Emamdoost.
      
      18) Uninitialized value in geneve_changelink(), from Cong Wang.
      
      19) Fix deadlock in xen-netfront, from Andera Righi.
      
      19) flush_backlog() frees skbs with IRQs disabled, so should use
          dev_kfree_skb_irq() instead of kfree_skb(). From Subash Abhinov
          Kasiviswanathan.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (111 commits)
        drivers/net/wan: lapb: Corrected the usage of skb_cow
        dev: Defer free of skbs in flush_backlog
        qrtr: orphan socket in qrtr_release()
        xen-netfront: fix potential deadlock in xennet_remove()
        flow_offload: Move rhashtable inclusion to the source file
        geneve: fix an uninitialized value in geneve_changelink()
        bonding: check return value of register_netdevice() in bond_newlink()
        tcp: allow at most one TLP probe per flight
        AX.25: Prevent integer overflows in connect and sendmsg
        cxgb4: add missing release on skb in uld_send()
        net: atlantic: fix PTP on AQC10X
        AX.25: Prevent out-of-bounds read in ax25_sendmsg()
        sctp: shrink stream outq when fails to do addstream reconf
        sctp: shrink stream outq only when new outcnt < old outcnt
        AX.25: Fix out-of-bounds read in ax25_connect()
        enetc: Remove the mdio bus on PF probe bailout
        net: ethernet: ti: add NETIF_F_HW_TC hw feature flag for taprio offload
        net: ethernet: ave: Fix error returns in ave_init
        drivers/net/wan/x25_asy: Fix to make it work
        ipvs: fix the connection sync failed in some cases
        ...
      1b64b2e2
    • Atish Patra's avatar
      riscv: Parse all memory blocks to remove unusable memory · fa5a1983
      Atish Patra authored
      Currently, maximum physical memory allowed is equal to -PAGE_OFFSET.
      That's why we remove any memory blocks spanning beyond that size. However,
      it is done only for memblock containing linux kernel which will not work
      if there are multiple memblocks.
      
      Process all memory blocks to figure out how much memory needs to be removed
      and remove at the end instead of updating the memblock list in place.
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      fa5a1983
    • Atish Patra's avatar
      RISC-V: Do not rely on initrd_start/end computed during early dt parsing · 4400231c
      Atish Patra authored
      Currently, initrd_start/end are computed during early_init_dt_scan
      but used during arch_setup. We will get the following panic if initrd is used
      and CONFIG_DEBUG_VIRTUAL is turned on.
      
      [    0.000000] ------------[ cut here ]------------
      [    0.000000] kernel BUG at arch/riscv/mm/physaddr.c:33!
      [    0.000000] Kernel BUG [#1]
      [    0.000000] Modules linked in:
      [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.8.0-rc4-00015-ged0b226fed02 #886
      [    0.000000] epc: ffffffe0002058d2 ra : ffffffe0000053f0 sp : ffffffe001001f40
      [    0.000000]  gp : ffffffe00106e250 tp : ffffffe001009d40 t0 : ffffffe00107ee28
      [    0.000000]  t1 : 0000000000000000 t2 : ffffffe000a2e880 s0 : ffffffe001001f50
      [    0.000000]  s1 : ffffffe0001383e8 a0 : ffffffe00c087e00 a1 : 0000000080200000
      [    0.000000]  a2 : 00000000010bf000 a3 : ffffffe00106f3c8 a4 : ffffffe0010bf000
      [    0.000000]  a5 : ffffffe000000000 a6 : 0000000000000006 a7 : 0000000000000001
      [    0.000000]  s2 : ffffffe00106f068 s3 : ffffffe00106f070 s4 : 0000000080200000
      [    0.000000]  s5 : 0000000082200000 s6 : 0000000000000000 s7 : 0000000000000000
      [    0.000000]  s8 : 0000000080011010 s9 : 0000000080012700 s10: 0000000000000000
      [    0.000000]  s11: 0000000000000000 t3 : 000000000001fe30 t4 : 000000000001fe30
      [    0.000000]  t5 : 0000000000000000 t6 : ffffffe00107c471
      [    0.000000] status: 0000000000000100 badaddr: 0000000000000000 cause: 0000000000000003
      [    0.000000] random: get_random_bytes called from print_oops_end_marker+0x22/0x46 with crng_init=0
      
      To avoid the error, initrd_start/end can be computed from phys_initrd_start/size
      in setup itself. It also improves the initrd placement by aligning the start
      and size with the page size.
      
      Fixes: 76d2a049 ("RISC-V: Init and Halt Code")
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      4400231c
    • Xie He's avatar
      drivers/net/wan: lapb: Corrected the usage of skb_cow · 8754e137
      Xie He authored
      This patch fixed 2 issues with the usage of skb_cow in LAPB drivers
      "lapbether" and "hdlc_x25":
      
      1) After skb_cow fails, kfree_skb should be called to drop a reference
      to the skb. But in both drivers, kfree_skb is not called.
      
      2) skb_cow should be called before skb_push so that is can ensure the
      safety of skb_push. But in "lapbether", it is incorrectly called after
      skb_push.
      
      More details about these 2 issues:
      
      1) The behavior of calling kfree_skb on failure is also the behavior of
      netif_rx, which is called by this function with "return netif_rx(skb);".
      So this function should follow this behavior, too.
      
      2) In "lapbether", skb_cow is called after skb_push. This results in 2
      logical issues:
         a) skb_push is not protected by skb_cow;
         b) An extra headroom of 1 byte is ensured after skb_push. This extra
            headroom has no use in this function. It also has no use in the
            upper-layer function that this function passes the skb to
            (x25_lapb_receive_frame in net/x25/x25_dev.c).
      So logically skb_cow should instead be called before skb_push.
      
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Martin Schiller <ms@dev.tdt.de>
      Signed-off-by: default avatarXie He <xie.he.0141@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8754e137
    • Subash Abhinov Kasiviswanathan's avatar
      dev: Defer free of skbs in flush_backlog · 7df5cb75
      Subash Abhinov Kasiviswanathan authored
      IRQs are disabled when freeing skbs in input queue.
      Use the IRQ safe variant to free skbs here.
      
      Fixes: 145dd5f9 ("net: flush the softnet backlog in process context")
      Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7df5cb75
    • Atish Patra's avatar
      RISC-V: Set maximum number of mapped pages correctly · d0d8aae6
      Atish Patra authored
      Currently, maximum number of mapper pages are set to the pfn calculated
      from the memblock size of the memblock containing kernel. This will work
      until that memblock spans the entire memory. However, it will be set to
      a wrong value if there are multiple memblocks defined in kernel
      (e.g. with efi runtime services).
      
      Set the the maximum value to the pfn calculated from dram size.
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      d0d8aae6
    • Linus Torvalds's avatar
      Merge tag 'pci-v5.8-fixes-2' of... · 23ee3e4e
      Linus Torvalds authored
      Merge tag 'pci-v5.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into master
      
      Pull PCI fixes from Bjorn Helgaas:
      
       - Reject invalid IRQ 0 command line argument for virtio_mmio because
         IRQ 0 now generates warnings (Bjorn Helgaas)
      
       - Revert "PCI/PM: Assume ports without DLL Link Active train links in
         100 ms", which broke nouveau (Bjorn Helgaas)
      
      * tag 'pci-v5.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        Revert "PCI/PM: Assume ports without DLL Link Active train links in 100 ms"
        virtio-mmio: Reject invalid IRQ 0 command line argument
      23ee3e4e
    • Cong Wang's avatar
      qrtr: orphan socket in qrtr_release() · af9f691f
      Cong Wang authored
      We have to detach sock from socket in qrtr_release(),
      otherwise skb->sk may still reference to this socket
      when the skb is released in tun->queue, particularly
      sk->sk_wq still points to &sock->wq, which leads to
      a UAF.
      
      Reported-and-tested-by: syzbot+6720d64f31c081c2f708@syzkaller.appspotmail.com
      Fixes: 28fb4e59 ("net: qrtr: Expose tunneling endpoint to user space")
      Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      af9f691f
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-2020-07-24' of... · 657237f5
      David S. Miller authored
      Merge tag 'wireless-drivers-2020-07-24' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for v5.8
      
      Second set of fixes for v5.8, and hopefully also the last. Three
      important regressions fixed.
      
      ath9k
      
      * fix a regression which broke support for all ath9k usb devices
      
      ath10k
      
      * fix a regression which broke support for all QCA4019 AHB devices
      
      iwlwifi
      
      * fix a regression which broke support for some Killer Wireless-AC 1550 cards
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      657237f5
    • Andrea Righi's avatar
      xen-netfront: fix potential deadlock in xennet_remove() · c2c63310
      Andrea Righi authored
      There's a potential race in xennet_remove(); this is what the driver is
      doing upon unregistering a network device:
      
        1. state = read bus state
        2. if state is not "Closed":
        3.    request to set state to "Closing"
        4.    wait for state to be set to "Closing"
        5.    request to set state to "Closed"
        6.    wait for state to be set to "Closed"
      
      If the state changes to "Closed" immediately after step 1 we are stuck
      forever in step 4, because the state will never go back from "Closed" to
      "Closing".
      
      Make sure to check also for state == "Closed" in step 4 to prevent the
      deadlock.
      
      Also add a 5 sec timeout any time we wait for the bus state to change,
      to avoid getting stuck forever in wait_event().
      Signed-off-by: default avatarAndrea Righi <andrea.righi@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c2c63310
  4. 24 Jul, 2020 2 commits