Skip to content
  1. Apr 11, 2021
  2. Apr 09, 2021
  3. Apr 07, 2021
  4. Apr 06, 2021
  5. Apr 05, 2021
    • Linus Torvalds's avatar
      Linux 5.12-rc6 · e49d033b
      Linus Torvalds authored
      v5.12-rc6
      e49d033b
    • Zheyu Ma's avatar
      firewire: nosy: Fix a use-after-free bug in nosy_ioctl() · 829933ef
      Zheyu Ma authored
      
      
      For each device, the nosy driver allocates a pcilynx structure.
      A use-after-free might happen in the following scenario:
      
       1. Open nosy device for the first time and call ioctl with command
          NOSY_IOC_START, then a new client A will be malloced and added to
          doubly linked list.
       2. Open nosy device for the second time and call ioctl with command
          NOSY_IOC_START, then a new client B will be malloced and added to
          doubly linked list.
       3. Call ioctl with command NOSY_IOC_START for client A, then client A
          will be readded to the doubly linked list. Now the doubly linked
          list is messed up.
       4. Close the first nosy device and nosy_release will be called. In
          nosy_release, client A will be unlinked and freed.
       5. Close the second nosy device, and client A will be referenced,
          resulting in UAF.
      
      The root cause of this bug is that the element in the doubly linked list
      is reentered into the list.
      
      Fix this bug by adding a check before inserting a client.  If a client
      is already in the linked list, don't insert it.
      
      The following KASAN report reveals it:
      
         BUG: KASAN: use-after-free in nosy_release+0x1ea/0x210
         Write of size 8 at addr ffff888102ad7360 by task poc
         CPU: 3 PID: 337 Comm: poc Not tainted 5.12.0-rc5+ #6
         Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
         Call Trace:
           nosy_release+0x1ea/0x210
           __fput+0x1e2/0x840
           task_work_run+0xe8/0x180
           exit_to_user_mode_prepare+0x114/0x120
           syscall_exit_to_user_mode+0x1d/0x40
           entry_SYSCALL_64_after_hwframe+0x44/0xae
      
         Allocated by task 337:
           nosy_open+0x154/0x4d0
           misc_open+0x2ec/0x410
           chrdev_open+0x20d/0x5a0
           do_dentry_open+0x40f/0xe80
           path_openat+0x1cf9/0x37b0
           do_filp_open+0x16d/0x390
           do_sys_openat2+0x11d/0x360
           __x64_sys_open+0xfd/0x1a0
           do_syscall_64+0x33/0x40
           entry_SYSCALL_64_after_hwframe+0x44/0xae
      
         Freed by task 337:
           kfree+0x8f/0x210
           nosy_release+0x158/0x210
           __fput+0x1e2/0x840
           task_work_run+0xe8/0x180
           exit_to_user_mode_prepare+0x114/0x120
           syscall_exit_to_user_mode+0x1d/0x40
           entry_SYSCALL_64_after_hwframe+0x44/0xae
      
         The buggy address belongs to the object at ffff888102ad7300 which belongs to the cache kmalloc-128 of size 128
         The buggy address is located 96 bytes inside of 128-byte region [ffff888102ad7300, ffff888102ad7380)
      
      [ Modified to use 'list_empty()' inside proper lock  - Linus ]
      
      Link: https://lore.kernel.org/lkml/1617433116-5930-1-git-send-email-zheyuma97@gmail.com/
      Reported-and-tested-by: default avatar马哲宇 (Zheyu Ma) <zheyuma97@gmail.com>
      Signed-off-by: default avatarZheyu Ma <zheyuma97@gmail.com>
      Cc: Greg Kroah-Hartman <greg@kroah.com>
      Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      829933ef
  6. Apr 04, 2021
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://github.com/openrisc/linux · 2023a53b
      Linus Torvalds authored
      Pull OpenRISC fix from Stafford Horne:
       "Fix duplicate header include in Litex SOC driver"
      
      * tag 'for-linus' of git://github.com/openrisc/linux:
        soc: litex: Remove duplicated header file inclusion
      2023a53b
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.12-2021-04-03' of git://git.kernel.dk/linux-block · d83e98f9
      Linus Torvalds authored
      POull io_uring fix from Jens Axboe:
       "Just fixing a silly braino in a previous patch, where we'd end up
        failing to compile if CONFIG_BLOCK isn't enabled.
      
        Not that a lot of people do that, but kernel bot spotted it and it's
        probably prudent to just flush this out now before -rc6.
      
        Sorry about that, none of my test compile configs have !CONFIG_BLOCK"
      
      * tag 'io_uring-5.12-2021-04-03' of git://git.kernel.dk/linux-block:
        io_uring: fix !CONFIG_BLOCK compilation failure
      d83e98f9
    • Zhen Lei's avatar
      soc: litex: Remove duplicated header file inclusion · 1683f7de
      Zhen Lei authored
      
      
      The header file <linux/errno.h> is already included above and can be
      removed here.
      
      Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
      Signed-off-by: default avatarMateusz Holenko <mholenko@antmicro.com>
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      1683f7de
    • Linus Torvalds's avatar
      Merge tag 'gfs2-v5.12-rc2-fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · 8e29be34
      Linus Torvalds authored
      Pull gfs2 fixes from Andreas Gruenbacher:
       "Two more gfs2 fixes"
      
      * tag 'gfs2-v5.12-rc2-fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: report "already frozen/thawed" errors
        gfs2: Flag a withdraw if init_threads() fails
      8e29be34
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 7fd7d5c2
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
       "A handful of fixes for 5.12:
      
         - fix a stack tracing regression related to "const register asm"
           variables, which have unexpected behavior.
      
         - ensure the value to be written by put_user() is evaluated before
           enabling access to userspace memory..
      
         - align the exception vector table correctly, so we don't rely on the
           firmware's handling of unaligned accesses.
      
         - build fix to make NUMA depend on MMU, which triggered on some
           randconfigs"
      
      * tag 'riscv-for-linus-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: Make NUMA depend on MMU
        riscv: remove unneeded semicolon
        riscv,entry: fix misaligned base for excp_vect_table
        riscv: evaluate put_user() arg before enabling user access
        riscv: Drop const annotation for sp
      7fd7d5c2
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.12-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 9c2ef23e
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Fix a bug on pseries where spurious wakeups from H_PROD would prevent
        partition migration from succeeding.
      
        Fix oopses seen in pcpu_alloc(), caused by parallel faults of the
        percpu mapping causing us to corrupt the protection key used for the
        mapping, and cause a fatal key fault.
      
        Thanks to Aneesh Kumar K.V, Murilo Opsfelder Araujo, and Nathan Lynch"
      
      * tag 'powerpc-5.12-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/mm/book3s64: Use the correct storage key value when calling H_PROTECT
        powerpc/pseries/mobility: handle premature return from H_JOIN
        powerpc/pseries/mobility: use struct for shared state
      9c2ef23e
    • Linus Torvalds's avatar
      Merge tag 'hyperv-fixes-signed-20210402' of... · fa161995
      Linus Torvalds authored
      Merge tag 'hyperv-fixes-signed-20210402' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
      
      Pull Hyper-V fixes from Wei Liu:
       "One fix from Lu Yunlong for a double free in hvfb_probe"
      
      * tag 'hyperv-fixes-signed-20210402' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
        video: hyperv_fb: Fix a double free in hvfb_probe
      fa161995
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.12-rc6' of... · f5664825
      Linus Torvalds authored
      Merge tag 'driver-core-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fix from Greg KH:
       "Here is a single driver core fix for a reported problem with differed
        probing. It has been in linux-next for a while with no reported
        problems"
      
      * tag 'driver-core-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        driver core: clear deferred probe reason on probe retry
      f5664825
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · a443930a
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are a few small driver char/misc changes for 5.12-rc6.
      
        Nothing major here, a few fixes for reported issues:
      
         - interconnect fixes for problems found
      
         - fbcon syzbot-found fix
      
         - extcon fixes
      
         - firmware stratix10 bugfix
      
         - MAINTAINERS file update.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'char-misc-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        drivers: video: fbcon: fix NULL dereference in fbcon_cursor()
        mei: allow map and unmap of client dma buffer only for disconnected client
        MAINTAINERS: Add linux-phy list and patchwork
        interconnect: Fix kerneldoc warning
        firmware: stratix10-svc: reset COMMAND_RECONFIG_FLAG_PARTIAL to 0
        extcon: Fix error handling in extcon_dev_register
        extcon: Add stubs for extcon_register_notifier_all() functions
        interconnect: core: fix error return code of icc_link_destroy()
        interconnect: qcom: msm8939: remove rpm-ids from non-RPM nodes
      a443930a
    • Linus Torvalds's avatar
      Merge tag 'staging-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 3e707eb6
      Linus Torvalds authored
      Pull staging driver fixes from Greg KH:
       "Here are two rtl8192e staging driver fixes for reported problems.
      
        Both of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'staging-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: rtl8192e: Change state information from u16 to u8
        staging: rtl8192e: Fix incorrect source in memcpy()
      3e707eb6
    • Linus Torvalds's avatar
      Merge tag 'tty-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 0d2c5a9e
      Linus Torvalds authored
      Pull serial driver fix from Greg KH:
       "Here is a single serial driver fix for 5.12-rc6. Is is a revert of a
        change that showed up in 5.9 that has been reported to cause problems.
      
        It has been in linux-next for a while with no reported issues"
      
      * tag 'tty-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        soc: qcom-geni-se: Cleanup the code to remove proxy votes
      0d2c5a9e
    • Linus Torvalds's avatar
      Merge tag 'usb-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · de879a8d
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are a few small USB driver fixes for 5.12-rc6 to resolve reported
        problems.
      
        They include:
      
         - a number of cdc-acm fixes for reported problems. It seems more
           people are using this driver lately...
      
         - dwc3 driver fixes for reported problems, and fixes for the fixes :)
      
         - dwc2 driver fixes for reported issues.
      
         - musb driver fix.
      
         - new USB quirk additions.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'usb-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (23 commits)
        usb: dwc2: Prevent core suspend when port connection flag is 0
        usb: dwc2: Fix HPRT0.PrtSusp bit setting for HiKey 960 board.
        usb: musb: Fix suspend with devices connected for a64
        usb: xhci-mtk: fix broken streams issue on 0.96 xHCI
        usb: dwc3: gadget: Clear DEP flags after stop transfers in ep disable
        usbip: vhci_hcd fix shift out-of-bounds in vhci_hub_control()
        USB: quirks: ignore remote wake-up on Fibocom L850-GL LTE modem
        USB: cdc-acm: do not log successful probe on later errors
        USB: cdc-acm: always claim data interface
        USB: cdc-acm: use negation for NULL checks
        USB: cdc-acm: clean up probe error labels
        USB: cdc-acm: drop redundant driver-data reset
        USB: cdc-acm: drop redundant driver-data assignment
        USB: cdc-acm: fix use-after-free after probe failure
        USB: cdc-acm: fix double free on probe failure
        USB: cdc-acm: downgrade message to debug
        USB: cdc-acm: untangle a circular dependency between callback and softint
        cdc-acm: fix BREAK rx code path adding necessary calls
        usb: gadget: udc: amd5536udc_pci fix null-ptr-dereference
        usb: dwc3: pci: Enable dis_uX_susphy_quirk for Intel Merrifield
        ...
      de879a8d