1. 20 May, 2021 5 commits
    • Anna Schumaker's avatar
      NFSv4: Fix a NULL pointer dereference in pnfs_mark_matching_lsegs_return() · a421d218
      Anna Schumaker authored
      Commit de144ff4 changes _pnfs_return_layout() to call
      pnfs_mark_matching_lsegs_return() passing NULL as the struct
      pnfs_layout_range argument. Unfortunately,
      pnfs_mark_matching_lsegs_return() doesn't check if we have a value here
      before dereferencing it, causing an oops.
      
      I'm able to hit this crash consistently when running connectathon basic
      tests on NFS v4.1/v4.2 against Ontap.
      
      Fixes: de144ff4 ("NFSv4: Don't discard segments marked for return in _pnfs_return_layout()")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      a421d218
    • NeilBrown's avatar
      SUNRPC in case of backlog, hand free slots directly to waiting task · e877a88d
      NeilBrown authored
      If sunrpc.tcp_max_slot_table_entries is small and there are tasks
      on the backlog queue, then when a request completes it is freed and the
      first task on the queue is woken.  The expectation is that it will wake
      and claim that request.  However if it was a sync task and the waiting
      process was killed at just that moment, it will wake and NOT claim the
      request.
      
      As long as TASK_CONGESTED remains set, requests can only be claimed by
      tasks woken from the backlog, and they are woken only as requests are
      freed, so when a task doesn't claim a request, no other task can ever
      get that request until TASK_CONGESTED is cleared.  Each time this
      happens the number of available requests is decreased by one.
      
      With a sufficiently high workload and sufficiently low setting of
      max_slot (16 in the case where this was seen), TASK_CONGESTED can remain
      set for an extended period, and the above scenario (of a process being
      killed just as its task was woken) can repeat until no requests can be
      allocated.  Then traffic stops.
      
      This patch addresses the problem by introducing a positive handover of a
      request from a completing task to a backlog task - the request is never
      freed when there is a backlog.
      
      When a task is woken it might not already have a request attached in
      which case it is *not* freed (as with current code) but is initialised
      (if needed) and used.  If it isn't used it will eventually be freed by
      rpc_exit_task().  xprt_release() is enhanced to be able to correctly
      release an uninitialised request.
      
      Fixes: ba60eb25 ("SUNRPC: Fix a livelock problem in the xprt->backlog queue")
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      e877a88d
    • Yang Li's avatar
      pNFS/NFSv4: Remove redundant initialization of 'rd_size' · d1d97395
      Yang Li authored
      Variable 'rd_size' is being initialized however
      this value is never read as 'rd_size' is assigned
      a new value in for statement. Remove the redundant
      assignment.
      
      Clean up clang warning:
      
      fs/nfs/pnfs.c:2681:6: warning: Value stored to 'rd_size' during its
      initialization is never read [clang-analyzer-deadcode.DeadStores]
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      d1d97395
    • Dan Carpenter's avatar
      NFS: fix an incorrect limit in filelayout_decode_layout() · 769b01ea
      Dan Carpenter authored
      The "sizeof(struct nfs_fh)" is two bytes too large and could lead to
      memory corruption.  It should be NFS_MAXFHSIZE because that's the size
      of the ->data[] buffer.
      
      I reversed the size of the arguments to put the variable on the left.
      
      Fixes: 16b374ca ("NFSv4.1: pnfs: filelayout: add driver's LAYOUTGET and GETDEVICEINFO infrastructure")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      769b01ea
    • zhouchuangao's avatar
      fs/nfs: Use fatal_signal_pending instead of signal_pending · bb002388
      zhouchuangao authored
      We set the state of the current process to TASK_KILLABLE via
      prepare_to_wait(). Should we use fatal_signal_pending() to detect
      the signal here?
      
      Fixes: b4868b44 ("NFSv4: Wait for stateid updates after CLOSE/OPEN_DOWNGRADE")
      Signed-off-by: default avatarzhouchuangao <zhouchuangao@vivo.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      bb002388
  2. 16 May, 2021 7 commits
    • Linus Torvalds's avatar
      Linux 5.13-rc2 · d07f6ca9
      Linus Torvalds authored
      d07f6ca9
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.13-rc2' of... · 28183dbf
      Linus Torvalds authored
      Merge tag 'driver-core-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core fixes from Greg KH:
       "Here are two driver fixes for driver core changes that happened in
        5.13-rc1.
      
        The clk driver fix resolves a many-reported issue with booting some
        devices, and the USB typec fix resolves the reported problem of USB
        systems on some embedded boards.
      
        Both of these have been in linux-next this week with no reported
        issues"
      
      * tag 'driver-core-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        clk: Skip clk provider registration when np is NULL
        usb: typec: tcpm: Don't block probing of consumers of "connector" nodes
      28183dbf
    • Linus Torvalds's avatar
      Merge tag 'staging-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 6942d81a
      Linus Torvalds authored
      Pull staging and IIO driver fixes from Greg KH:
       "Here are some small IIO driver fixes and one Staging driver fix for
        5.13-rc2.
      
        Nothing major, just some resolutions for reported problems:
      
         - gcc-11 bogus warning fix for rtl8723bs
      
         - iio driver tiny fixes
      
        All of these have been in linux-next for many days with no reported
        issues"
      
      * tag 'staging-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        iio: tsl2583: Fix division by a zero lux_val
        iio: core: return ENODEV if ioctl is unknown
        iio: core: fix ioctl handlers removal
        iio: gyro: mpu3050: Fix reported temperature value
        iio: hid-sensors: select IIO_TRIGGERED_BUFFER under HID_SENSOR_IIO_TRIGGER
        iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
        iio: light: gp2ap002: Fix rumtime PM imbalance on error
        staging: rtl8723bs: avoid bogus gcc warning
      6942d81a
    • Linus Torvalds's avatar
      Merge tag 'usb-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 4a668429
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some small USB fixes for 5.13-rc2. They consist of a number
        of resolutions for reported issues:
      
         - typec fixes for found problems
      
         - xhci fixes and quirk additions
      
         - dwc3 driver fixes
      
         - minor fixes found by Coverity
      
         - cdc-wdm fixes for reported problems
      
        All of these have been in linux-next for a few days with no reported
        issues"
      
      * tag 'usb-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (28 commits)
        usb: core: hub: fix race condition about TRSMRCY of resume
        usb: typec: tcpm: Fix SINK_DISCOVERY current limit for Rp-default
        xhci: Add reset resume quirk for AMD xhci controller.
        usb: xhci: Increase timeout for HC halt
        xhci: Do not use GFP_KERNEL in (potentially) atomic context
        xhci: Fix giving back cancelled URBs even if halted endpoint can't reset
        xhci-pci: Allow host runtime PM as default for Intel Alder Lake xHCI
        usb: musb: Fix an error message
        usb: typec: tcpm: Fix wrong handling for Not_Supported in VDM AMS
        usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work
        usb: typec: ucsi: Retrieve all the PDOs instead of just the first 4
        usb: fotg210-hcd: Fix an error message
        docs: usb: function: Modify path name
        usb: dwc3: omap: improve extcon initialization
        usb: typec: ucsi: Put fwnode in any case during ->probe()
        usb: typec: tcpm: Fix wrong handling in GET_SINK_CAP
        usb: dwc2: Remove obsolete MODULE_ constants from platform.c
        usb: dwc3: imx8mp: fix error return code in dwc3_imx8mp_probe()
        usb: dwc3: imx8mp: detect dwc3 core node via compatible string
        usb: dwc3: gadget: Return success always for kick transfer in ep queue
        ...
      4a668429
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2021-05-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 8ce36481
      Linus Torvalds authored
      Pull timer fixes from Thomas Gleixner:
       "Two fixes for timers:
      
         - Use the ALARM feature check in the alarmtimer core code insted of
           the old method of checking for the set_alarm() callback.
      
           Drivers can have that callback set but the feature bit cleared. If
           such a RTC device is selected then alarms wont work.
      
         - Use a proper define to let the preprocessor check whether Hyper-V
           VDSO clocksource should be active.
      
           The code used a constant in an enum with #ifdef, which evaluates to
           always false and disabled the clocksource for VDSO"
      
      * tag 'timers-urgent-2021-05-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
        alarmtimer: Check RTC features instead of ops
      8ce36481
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · f44e58bb
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
      
       - two patches for error path fixes
      
       - a small series for fixing a regression with swiotlb with Xen on Arm
      
      * tag 'for-linus-5.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/swiotlb: check if the swiotlb has already been initialized
        arm64: do not set SWIOTLB_NO_FORCE when swiotlb is required
        xen/arm: move xen_swiotlb_detect to arm/swiotlb-xen.h
        xen/unpopulated-alloc: fix error return code in fill_list()
        xen/gntdev: fix gntdev_mmap() error exit path
      f44e58bb
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v5.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ccb013c2
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
       "The three SEV commits are not really urgent material. But we figured
        since getting them in now will avoid a huge amount of conflicts
        between future SEV changes touching tip, the kvm and probably other
        trees, sending them to you now would be best.
      
        The idea is that the tip, kvm etc branches for 5.14 will all base
        ontop of -rc2 and thus everything will be peachy. What is more, those
        changes are purely mechanical and defines movement so they should be
        fine to go now (famous last words).
      
        Summary:
      
         - Enable -Wundef for the compressed kernel build stage
      
         - Reorganize SEV code to streamline and simplify future development"
      
      * tag 'x86_urgent_for_v5.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/boot/compressed: Enable -Wundef
        x86/msr: Rename MSR_K8_SYSCFG to MSR_AMD64_SYSCFG
        x86/sev: Move GHCB MSR protocol and NAE definitions in a common header
        x86/sev-es: Rename sev-es.{ch} to sev.{ch}
      ccb013c2
  3. 15 May, 2021 27 commits
  4. 14 May, 2021 1 commit