1. May 25, 2022
    • Bob Peterson's avatar
      gfs2: use i_lock spin_lock for inode qadata · 5fcff61e
      Bob Peterson authored
      
      
      Before this patch, functions gfs2_qa_get and _put used the i_rw_mutex to
      prevent simultaneous access to its i_qadata. But i_rw_mutex is now used
      for many other things, including iomap_begin and end, which causes a
      conflict according to lockdep. We cannot just remove the lock since
      simultaneous opens (gfs2_open -> gfs2_open_common -> gfs2_qa_get) can
      then stomp on each others values for i_qadata.
      
      This patch solves the conflict by using the i_lock spin_lock in the inode
      to prevent simultaneous access.
      
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      5fcff61e
    • Andrew Price's avatar
      gfs2: Return more useful errors from gfs2_rgrp_send_discards() · f4a47561
      Andrew Price authored
      The bug that 27ca8273
      
       ("gfs2: Make sure FITRIM minlen is rounded up to
      fs block size") fixes was a little confusing as the user saw
      "Input/output error" which masked the -EINVAL that sb_issue_discard()
      returned.
      
      sb_issue_discard() can fail for various reasons, so we should return its
      return value from gfs2_rgrp_send_discards() to avoid all errors being
      reported as IO errors.
      
      This improves error reporting for FITRIM and makes no difference to the
      -o discard code path because the return value from
      gfs2_rgrp_send_discards() gets thrown away in that case (and the option
      switches off). Presumably that's why it was ok to just return -EIO in
      the past, before FITRIM was implemented.
      
      Tested with xfstests.
      
      Signed-off-by: default avatarAndrew Price <anprice@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      f4a47561
    • Kees Cook's avatar
      gfs2: Use container_of() for gfs2_glock(aspace) · 11d8b79e
      Kees Cook authored
      
      
      Clang's structure layout randomization feature gets upset when it sees
      struct address_space (which is randomized) cast to struct gfs2_glock.
      This is due to seeing the mapping pointer as being treated as an array
      of gfs2_glock, rather than "something else, before struct address_space":
      
      In file included from fs/gfs2/acl.c:23:
      fs/gfs2/meta_io.h:44:12: error: casting from randomized structure pointer type 'struct address_space *' to 'struct gfs2_glock *'
      	return (((struct gfs2_glock *)mapping) - 1)->gl_name.ln_sbd;
      		^
      
      Replace the instances of open-coded pointer math with container_of()
      usage, and update the allocator to match.
      
      Some cleanups and conversion of gfs2_glock_get() and
      gfs2_glock_dealloc() by Andreas.
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Link: https://lore.kernel.org/lkml/202205041550.naKxwCBj-lkp@intel.com
      
      
      Cc: Bob Peterson <rpeterso@redhat.com>
      Cc: Andreas Gruenbacher <agruenba@redhat.com>
      Cc: Bill Wendling <morbo@google.com>
      Cc: cluster-devel@redhat.com
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      11d8b79e
    • Andreas Gruenbacher's avatar
      gfs2: Explain some direct I/O oddities · 53bb540f
      Andreas Gruenbacher authored
      
      
      Add some comments explaining the oddities of partial direct I/O reads
      and writes.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      53bb540f
  2. May 14, 2022
    • Jakob Koschel's avatar
      gfs2: replace 'found' with dedicated list iterator variable · b846f2d7
      Jakob Koschel authored
      To move the list iterator variable into the list_for_each_entry_*()
      macro in the future it should be avoided to use the list iterator
      variable after the loop body.
      
      To *never* use the list iterator variable after the loop it was
      concluded to use a separate iterator variable instead of a
      found boolean [1].
      
      This removes the need to use a found variable and simply checking if
      the variable was set, can determine if the break/goto was hit.
      
      Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/
      
       [1]
      Signed-off-by: default avatarJakob Koschel <jakobkoschel@gmail.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      b846f2d7
    • Linus Torvalds's avatar
      Merge tag 'gfs2-v5.18-rc4-fix3' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · d928e8f3
      Linus Torvalds authored
      Pull gfs2 fixes from Andreas Gruenbacher:
       "We've finally identified commit dc732906 ("gfs2: Introduce flag
        for glock holder auto-demotion") to be the other cause of the
        filesystem corruption we've been seeing. This feature isn't strictly
        necessary anymore, so we've decided to stop using it for now.
      
        With this and the gfs_iomap_end rounding fix you've already seen
        ("gfs2: Fix filesystem block deallocation for short writes" in this
        pull request), we're corruption free again now.
      
         - Fix filesystem block deallocation for short writes.
      
         - Stop using glock holder auto-demotion for now.
      
         - Get rid of buffered writes inefficiencies due to page faults being
           disabled.
      
         - Minor other cleanups"
      
      * tag 'gfs2-v5.18-rc4-fix3' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: Stop using glock holder auto-demotion for now
        gfs2: buffered write prefaulting
        gfs2: Align read and write chunks to the page cache
        gfs2: Pull return value test out of should_fault_in_pages
        gfs2: Clean up use of fault_in_iov_iter_{read,write}able
        gfs2: Variable rename
        gfs2: Fix filesystem block deallocation for short writes
      d928e8f3
    • Andreas Gruenbacher's avatar
      gfs2: Stop using glock holder auto-demotion for now · e1fa9ea8
      Andreas Gruenbacher authored
      We're having unresolved issues with the glock holder auto-demotion mechanism
      introduced in commit dc732906.  This mechanism was assumed to be essential
      for avoiding frequent short reads and writes until commit 296abc0d
      
      
      ("gfs2: No short reads or writes upon glock contention").  Since then,
      when the inode glock is lost, it is simply re-acquired and the operation
      is resumed.  This means that apart from the performance penalty, we
      might as well drop the inode glock before faulting in pages, and
      re-acquire it afterwards.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      e1fa9ea8
    • Andreas Gruenbacher's avatar
      gfs2: buffered write prefaulting · fa5dfa64
      Andreas Gruenbacher authored
      
      
      In gfs2_file_buffered_write, to increase the likelihood that all the
      user memory we're trying to write will be resident in memory, carry out
      the write in chunks and fault in each chunk of user memory before trying
      to write it.  Otherwise, some workloads will trigger frequent short
      "internal" writes, causing filesystem blocks to be allocated and then
      partially deallocated again when writing into holes, which is wasteful
      and breaks reservations.
      
      Neither the chunked writes nor any of the short "internal" writes are
      user visible.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      fa5dfa64
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · f2dd0074
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Four fixes, all in drivers.
      
        These patches mosly fix error legs and exceptional conditions
        (scsi_dh_alua, qla2xxx). The lpfc fixes are for coding issues with
        lpfc features"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: lpfc: Correct BDE DMA address assignment for GEN_REQ_WQE
        scsi: lpfc: Fix split code for FLOGI on FCoE
        scsi: qla2xxx: Fix missed DMA unmap for aborted commands
        scsi: scsi_dh_alua: Properly handle the ALUA transitioning state
      f2dd0074
    • Andreas Gruenbacher's avatar
      gfs2: Align read and write chunks to the page cache · 324d116c
      Andreas Gruenbacher authored
      
      
      Align the chunks that reads and writes are carried out in to the page
      cache rather than the user buffers.  This will be more efficient in
      general, especially for allocating writes.  Optimizing the case that the
      user buffer is gfs2 backed isn't very useful; we only need to make sure
      we won't deadlock.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      324d116c
    • Andreas Gruenbacher's avatar
      gfs2: Pull return value test out of should_fault_in_pages · 72382264
      Andreas Gruenbacher authored
      
      
      Pull the return value test of the previous read or write operation out
      of should_fault_in_pages().  In a following patch, we'll fault in pages
      before the I/O and there will be no return value to check.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      72382264
    • Andreas Gruenbacher's avatar
      gfs2: Clean up use of fault_in_iov_iter_{read,write}able · 6d22ff47
      Andreas Gruenbacher authored
      
      
      No need to store the return value of the fault_in functions in separate
      variables.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      6d22ff47
    • Andreas Gruenbacher's avatar
      gfs2: Variable rename · 42e4c3bd
      Andreas Gruenbacher authored
      
      
      Instead of counting the number of bytes read from the filesystem,
      functions gfs2_file_direct_read and gfs2_file_read_iter count the number
      of bytes written into the user buffer.  Conversely, functions
      gfs2_file_direct_write and gfs2_file_buffered_write count the number of
      bytes read from the user buffer.  This is nothing but confusing, so
      change the read functions to count how many bytes they have read, and
      the write functions to count how many bytes they have written.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      42e4c3bd
    • Andreas Gruenbacher's avatar
      gfs2: Fix filesystem block deallocation for short writes · d031a886
      Andreas Gruenbacher authored
      When a write cannot be carried out in full, gfs2_iomap_end() releases
      blocks that have been allocated for this write but haven't been used.
      
      To compute the end of the allocation, gfs2_iomap_end() incorrectly
      rounded the end of the attempted write down to the next block boundary
      to arrive at the end of the allocation.  It would have to round up, but
      the end of the allocation is also available as iomap->offset +
      iomap->length, so just use that instead.
      
      In addition, use round_up() for computing the start of the unused range.
      
      Fixes: 64bc06bb
      
       ("gfs2: iomap buffered write support")
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      d031a886
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-5.18-rc7' of https://github.com/ceph/ceph-client · c3f5e692
      Linus Torvalds authored
      Pull ceph fix from Ilya Dryomov:
       "Two fixes to properly maintain xattrs on async creates and thus
        preserve SELinux context on newly created files and to avoid improper
        usage of folio->private field which triggered BUG_ONs.
      
        Both marked for stable"
      
      * tag 'ceph-for-5.18-rc7' of https://github.com/ceph/ceph-client:
        ceph: check folio PG_private bit instead of folio->private
        ceph: fix setting of xattrs on async created inodes
      c3f5e692
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.18-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 6dd5884d
      Linus Torvalds authored
      Pull NFS client bugfixes from Trond Myklebust:
       "One more pull request. There was a bug in the fix to ensure that gss-
        proxy continues to work correctly after we fixed the AF_LOCAL socket
        leak in the RPC code. This therefore reverts that broken patch, and
        replaces it with one that works correctly.
      
        Stable fixes:
      
         - SUNRPC: Ensure that the gssproxy client can start in a connected
           state
      
        Bugfixes:
      
         - Revert "SUNRPC: Ensure gss-proxy connects on setup"
      
         - nfs: fix broken handling of the softreval mount option"
      
      * tag 'nfs-for-5.18-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        nfs: fix broken handling of the softreval mount option
        SUNRPC: Ensure that the gssproxy client can start in a connected state
        Revert "SUNRPC: Ensure gss-proxy connects on setup"
      6dd5884d
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm · 364a453a
      Linus Torvalds authored
      Pull misc fixes from Andrew Morton:
       "Seven MM fixes, three of which address issues added in the most recent
        merge window, four of which are cc:stable.
      
        Three non-MM fixes, none very serious"
      
      [ And yes, that's a real pull request from Andrew, not me creating a
        branch from emailed patches. Woo-hoo! ]
      
      * tag 'mm-hotfixes-stable-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        MAINTAINERS: add a mailing list for DAMON development
        selftests: vm: Makefile: rename TARGETS to VMTARGETS
        mm/kfence: reset PG_slab and memcg_data before freeing __kfence_pool
        mailmap: add entry for martyna.szapar-mudlaw@intel.com
        arm[64]/memremap: don't abuse pfn_valid() to ensure presence of linear map
        procfs: prevent unprivileged processes accessing fdinfo dir
        mm: mremap: fix sign for EFAULT error return value
        mm/hwpoison: use pr_err() instead of dump_page() in get_any_page()
        mm/huge_memory: do not overkill when splitting huge_zero_page
        Revert "mm/memory-failure.c: skip huge_zero_page in memory_failure()"
      364a453a
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 91bdba85
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
      
       - TLB invalidation workaround for Qualcomm Kryo-4xx "gold" CPUs
      
       - Fix broken dependency in the vDSO Makefile
      
       - Fix pointer authentication overrides in ISAR2 ID register
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Enable repeat tlbi workaround on KRYO4XX gold CPUs
        arm64: cpufeature: remove duplicate ID_AA64ISAR2_EL1 entry
        arm64: vdso: fix makefile dependency on vdso.so
      91bdba85
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v5.18-rc7' of... · 359ee4f4
      Linus Torvalds authored
      Merge tag 'hwmon-for-v5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
      
       - Restrict ltq-cputemp to SOC_XWAY to fix build failure
      
       - Add OF device ID table to tmp401 driver to enable auto-load
      
      * tag 'hwmon-for-v5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (ltq-cputemp) restrict it to SOC_XWAY
        hwmon: (tmp401) Add OF device ID table
      359ee4f4
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2022-05-13' of git://anongit.freedesktop.org/drm/drm · 10b4b67a
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Pretty quiet week on the fixes front, 4 amdgpu and one i915 fix.
      
        I think there might be a few misc fbdev ones outstanding, but I'll see
        if they are necessary and pass them on if so.
      
        amdgpu:
      
         - Disable ASPM for VI boards on ADL platforms
      
         - S0ix DCN3.1 display fix
      
         - Resume regression fix
      
         - Stable pstate fix
      
        i915:
      
         - fix for kernel memory corruption when running a lot of OpenCL tests
           in parallel"
      
      * tag 'drm-fixes-2022-05-13' of git://anongit.freedesktop.org/drm/drm:
        drm/amdgpu/ctx: only reset stable pstate if the user changed it (v2)
        Revert "drm/amd/pm: keep the BACO feature enabled for suspend"
        drm/i915: Fix race in __i915_vma_remove_closed
        drm/amd/display: undo clearing of z10 related function pointers
        drm/amdgpu: vi: disable ASPM on Intel Alder Lake based systems
      10b4b67a
  3. May 13, 2022
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-5.18-2022-05-11' of... · 5005e981
      Dave Airlie authored
      Merge tag 'amd-drm-fixes-5.18-2022-05-11' of https://gitlab.freedesktop.org/agd5f/linux
      
       into drm-fixes
      
      amd-drm-fixes-5.18-2022-05-11:
      
      amdgpu:
      - Disable ASPM for VI boards on ADL platforms
      - S0ix DCN3.1 display fix
      - Resume regression fix
      - Stable pstate fix
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220511174422.5769-1-alexander.deucher@amd.com
      5005e981
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2022-05-12' of... · c8f0c2d4
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2022-05-12' of git://anongit.freedesktop.org/drm/drm-intel
      
       into drm-fixes
      
      Fix for #5732: (Cc stable) kernel memory corruption when running a lot of OpenCL tests in parallel
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/YnykW6L4e7vD3yl3@jlahtine-mobl.ger.corp.intel.com
      c8f0c2d4
    • Linus Torvalds's avatar
      Merge tag 'net-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · f3f19f93
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from wireless, and bluetooth.
      
        No outstanding fires.
      
        Current release - regressions:
      
         - eth: atlantic: always deep reset on pm op, fix null-deref
      
        Current release - new code bugs:
      
         - rds: use maybe_get_net() when acquiring refcount on TCP sockets
           [refinement of a previous fix]
      
         - eth: ocelot: mark traps with a bool instead of guessing type based
           on list membership
      
        Previous releases - regressions:
      
         - net: fix skipping features in for_each_netdev_feature()
      
         - phy: micrel: fix null-derefs on suspend/resume and probe
      
         - bcmgenet: check for Wake-on-LAN interrupt probe deferral
      
        Previous releases - always broken:
      
         - ipv4: drop dst in multicast routing path, prevent leaks
      
         - ping: fix address binding wrt vrf
      
         - net: fix wrong network header length when BPF protocol translation
           is used on skbs with a fraglist
      
         - bluetooth: fix the creation of hdev->name
      
         - rfkill: uapi: fix RFKILL_IOCTL_MAX_SIZE ioctl request definition
      
         - wifi: iwlwifi: iwl-dbg: use del_timer_sync() before freeing
      
         - wifi: ath11k: reduce the wait time of 11d scan and hw scan while
           adding an interface
      
         - mac80211: fix rx reordering with non explicit / psmp ack policy
      
         - mac80211: reset MBSSID parameters upon connection
      
         - nl80211: fix races in nl80211_set_tx_bitrate_mask()
      
         - tls: fix context leak on tls_device_down
      
         - sched: act_pedit: really ensure the skb is writable
      
         - batman-adv: don't skb_split skbuffs with frag_list
      
         - eth: ocelot: fix various issues with TC actions (null-deref; bad
           stats; ineffective drops; ineffective filter removal)"
      
      * tag 'net-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (61 commits)
        tls: Fix context leak on tls_device_down
        net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe()
        net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending
        net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down()
        mlxsw: Avoid warning during ip6gre device removal
        net: bcmgenet: Check for Wake-on-LAN interrupt probe deferral
        net: ethernet: mediatek: ppe: fix wrong size passed to memset()
        Bluetooth: Fix the creation of hdev->name
        i40e: i40e_main: fix a missing check on list iterator
        net/sched: act_pedit: really ensure the skb is writable
        s390/lcs: fix variable dereferenced before check
        s390/ctcm: fix potential memory leak
        s390/ctcm: fix variable dereferenced before check
        net: atlantic: verify hw_head_ lies within TX buffer ring
        net: atlantic: add check for MAX_SKB_FRAGS
        net: atlantic: reduce scope of is_rsc_complete
        net: atlantic: fix "frag[0] not initialized"
        net: stmmac: fix missing pci_disable_device() on error in stmmac_pci_probe()
        net: phy: micrel: Fix incorrect variable type in micrel
        decnet: Use container_of() for struct dn_neigh casts
        ...
      f3f19f93
    • Linus Torvalds's avatar
      Merge branch 'for-5.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · 0ac824f3
      Linus Torvalds authored
      Pull cgroup fix from Tejun Heo:
       "Waiman's fix for a cgroup2 cpuset bug where it could miss nodes which
        were hot-added"
      
      * 'for-5.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        cgroup/cpuset: Remove cpus_allowed/mems_allowed setup in cpuset_init_smp()
      0ac824f3
    • Linus Torvalds's avatar
      Merge tag 'fixes_for_v5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · c37dba6a
      Linus Torvalds authored
      Pull fs fixes from Jan Kara:
       "Three fixes that I'd still like to get to 5.18:
      
         - add a missing sanity check in the fanotify FAN_RENAME feature
           (added in 5.17, let's fix it before it gets wider usage in
           userspace)
      
         - udf fix for recently introduced filesystem corruption issue
      
         - writeback fix for a race in inode list handling that can lead to
           delayed writeback and possible dirty throttling stalls"
      
      * tag 'fixes_for_v5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        udf: Avoid using stale lengthOfImpUse
        writeback: Avoid skipping inode writeback
        fanotify: do not allow setting dirent events in mask of non-dir
      c37dba6a
    • Maxim Mikityanskiy's avatar
      tls: Fix context leak on tls_device_down · 3740651b
      Maxim Mikityanskiy authored
      The commit cited below claims to fix a use-after-free condition after
      tls_device_down. Apparently, the description wasn't fully accurate. The
      context stayed alive, but ctx->netdev became NULL, and the offload was
      torn down without a proper fallback, so a bug was present, but a
      different kind of bug.
      
      Due to misunderstanding of the issue, the original patch dropped the
      refcount_dec_and_test line for the context to avoid the alleged
      premature deallocation. That line has to be restored, because it matches
      the refcount_inc_not_zero from the same function, otherwise the contexts
      that survived tls_device_down are leaked.
      
      This patch fixes the described issue by restoring refcount_dec_and_test.
      After this change, there is no leak anymore, and the fallback to
      software kTLS still works.
      
      Fixes: c55dcdd4
      
       ("net/tls: Fix use-after-free after the TLS device goes down and up")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@nvidia.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Link: https://lore.kernel.org/r/20220512091830.678684-1-maximmi@nvidia.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3740651b
    • Taehee Yoo's avatar
      net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe() · 1fa89ffb
      Taehee Yoo authored
      
      
      In the NIC ->probe() callback, ->mtd_probe() callback is called.
      If NIC has 2 ports, ->probe() is called twice and ->mtd_probe() too.
      In the ->mtd_probe(), which is efx_ef10_mtd_probe() it allocates and
      initializes mtd partiion.
      But mtd partition for sfc is shared data.
      So that allocated mtd partition data from last called
      efx_ef10_mtd_probe() will not be used.
      Therefore it must be freed.
      But it doesn't free a not used mtd partition data in efx_ef10_mtd_probe().
      
      kmemleak reports:
      unreferenced object 0xffff88811ddb0000 (size 63168):
        comm "systemd-udevd", pid 265, jiffies 4294681048 (age 348.586s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<ffffffffa3767749>] kmalloc_order_trace+0x19/0x120
          [<ffffffffa3873f0e>] __kmalloc+0x20e/0x250
          [<ffffffffc041389f>] efx_ef10_mtd_probe+0x11f/0x270 [sfc]
          [<ffffffffc0484c8a>] efx_pci_probe.cold.17+0x3df/0x53d [sfc]
          [<ffffffffa414192c>] local_pci_probe+0xdc/0x170
          [<ffffffffa4145df5>] pci_device_probe+0x235/0x680
          [<ffffffffa443dd52>] really_probe+0x1c2/0x8f0
          [<ffffffffa443e72b>] __driver_probe_device+0x2ab/0x460
          [<ffffffffa443e92a>] driver_probe_device+0x4a/0x120
          [<ffffffffa443f2ae>] __driver_attach+0x16e/0x320
          [<ffffffffa4437a90>] bus_for_each_dev+0x110/0x190
          [<ffffffffa443b75e>] bus_add_driver+0x39e/0x560
          [<ffffffffa4440b1e>] driver_register+0x18e/0x310
          [<ffffffffc02e2055>] 0xffffffffc02e2055
          [<ffffffffa3001af3>] do_one_initcall+0xc3/0x450
          [<ffffffffa33ca574>] do_init_module+0x1b4/0x700
      
      Acked-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
      Fixes: 8127d661
      
       ("sfc: Add support for Solarflare SFC9100 family")
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Link: https://lore.kernel.org/r/20220512054709.12513-1-ap420073@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1fa89ffb
    • Guangguan Wang's avatar
      net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending · f3c46e41
      Guangguan Wang authored
      Non blocking sendmsg will return -EAGAIN when any signal pending
      and no send space left, while non blocking recvmsg return -EINTR
      when signal pending and no data received. This may makes confused.
      As TCP returns -EAGAIN in the conditions described above. Align the
      behavior of smc with TCP.
      
      Fixes: 846e344e
      
       ("net/smc: add receive timeout check")
      Signed-off-by: default avatarGuangguan Wang <guangguan.wang@linux.alibaba.com>
      Reviewed-by: default avatarTony Lu <tonylu@linux.alibaba.com>
      Acked-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Link: https://lore.kernel.org/r/20220512030820.73848-1-guangguan.wang@linux.alibaba.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f3c46e41
    • Florian Fainelli's avatar
      net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down() · b7be130c
      Florian Fainelli authored
      After commit 2d1f90f9 ("net: dsa/bcm_sf2: fix incorrect usage of
      state->link") the interface suspend path would call our mac_link_down()
      call back which would forcibly set the link down, thus preventing
      Wake-on-LAN packets from reaching our management port.
      
      Fix this by looking at whether the port is enabled for Wake-on-LAN and
      not clearing the link status in that case to let packets go through.
      
      Fixes: 2d1f90f9
      
       ("net: dsa/bcm_sf2: fix incorrect usage of state->link")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20220512021731.2494261-1-f.fainelli@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b7be130c
  4. May 12, 2022
  5. May 11, 2022