1. 29 Mar, 2024 19 commits
    • Linus Torvalds's avatar
      Merge tag 'linux_kselftest-fixes-6.9-rc2' of... · 1ab5c8a3
      Linus Torvalds authored
      Merge tag 'linux_kselftest-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull kselftest fixes from Shuah Khan:
       "Fixes to seccomp and ftrace tests and a change to add config file for
        dmabuf-heap test to increase coverage"
      
      * tag 'linux_kselftest-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests: dmabuf-heap: add config file for the test
        selftests/seccomp: Try to fit runtime of benchmark into timeout
        selftests/ftrace: Fix event filter target_func selection
      1ab5c8a3
    • Linus Torvalds's avatar
      Merge tag 'linux_kselftest-kunit-fixes-6.9-rc2' of... · a2ad5d9e
      Linus Torvalds authored
      Merge tag 'linux_kselftest-kunit-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull KUnit fixes from Shuah Khan:
       "One urgent fix for --alltests build failure related to renaming of
        CONFIG_DAMON_DBGFS to DAMON_DBGFS_DEPRECATED to the missing config
        option"
      
      * tag 'linux_kselftest-kunit-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        kunit: configs: Enable CONFIG_DAMON_DBGFS_DEPRECATED for --alltests
      a2ad5d9e
    • Muhammad Usama Anjum's avatar
      selftests: dmabuf-heap: add config file for the test · 224fe424
      Muhammad Usama Anjum authored
      The config fragment enlists all the config options needed for the test.
      This config is merged into the kernel's config on which this test is
      run.
      
      Fixed whitespace errors during commit:
      Shuah Khan <skhan@linuxfoundation.org>
      Reviewed-by: default avatarT.J. Mercier <tjmercier@google.com>
      Signed-off-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      224fe424
    • Mark Brown's avatar
      selftests/seccomp: Try to fit runtime of benchmark into timeout · 7155cc45
      Mark Brown authored
      The seccomp benchmark runs five scenarios, one calibration run with no
      seccomp filters enabled then four further runs each adding a filter. The
      calibration run times itself for 15s and then each additional run executes
      for the same number of times.
      
      Currently the seccomp tests, including the benchmark, run with an extended
      120s timeout but this is not sufficient to robustly run the tests on a lot
      of platforms. Sample timings from some recent runs:
      
         Platform          Run 1  Run 2  Run 3  Run 4
         ---------         -----  -----  -----  -----
         PowerEdge R200    16.6s  16.6s  31.6s  37.4s
         BBB (arm)         20.4s  20.4s  54.5s
         Synquacer (arm64) 20.7s  23.7s  40.3s
      
      The x86 runs from the PowerEdge are quite marginal and routinely fail, for
      the successful run reported here the timed portions of the run are at
      117.2s leaving less than 3s of margin which is frequently breached. The
      added overhead of adding filters on the other platforms is such that there
      is no prospect of their runs fitting into the 120s timeout, especially
      on 32 bit arm where there is no BPF JIT.
      
      While we could lower the time we calibrate for I'm also already seeing the
      currently completing runs reporting issues with the per filter overheads
      not matching expectations:
      
      Let's instead raise the timeout to 180s which is only a 50% increase on the
      current timeout which is itself not *too* large given that there's only two
      tests in this suite.
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      7155cc45
    • Mark Rutland's avatar
      selftests/ftrace: Fix event filter target_func selection · 8ecab2e6
      Mark Rutland authored
      The event filter function test has been failing in our internal test
      farm:
      
      | # not ok 33 event filter function - test event filtering on functions
      
      Running the test in verbose mode indicates that this is because the test
      erroneously determines that kmem_cache_free() is the most common caller
      of kmem_cache_free():
      
        # # + cut -d: -f3 trace
        # # + sed s/call_site=([^+]*)+0x.*/1/
        # # + sort
        # # + uniq -c
        # # + sort
        # # + tail -n 1
        # # + sed s/^[ 0-9]*//
        # # + target_func=kmem_cache_free
      
      ... and as kmem_cache_free() doesn't call itself, setting this as the
      filter function for kmem_cache_free() results in no hits, and
      consequently the test fails:
      
        # # + grep kmem_cache_free trace
        # # + grep kmem_cache_free
        # # + wc -l
        # # + hitcnt=0
        # # + grep kmem_cache_free trace
        # # + grep -v kmem_cache_free
        # # + wc -l
        # # + misscnt=0
        # # + [ 0 -eq 0 ]
        # # + exit_fail
      
      This seems to be because the system in question has tasks with ':' in
      their name (which a number of kernel worker threads have). These show up
      in the trace, e.g.
      
        test:.sh-1299    [004] .....  2886.040608: kmem_cache_free: call_site=putname+0xa4/0xc8 ptr=000000000f4d22f4 name=names_cache
      
      ... and so when we try to extact the call_site with:
      
        cut -d: -f3 trace | sed 's/call_site=\([^+]*\)+0x.*/\1/'
      
      ... the 'cut' command will extrace the column containing
      'kmem_cache_free' rather than the column containing 'call_site=...', and
      the 'sed' command will leave this unchanged. Consequently, the test will
      decide to use 'kmem_cache_free' as the filter function, resulting in the
      failure seen above.
      
      Fix this by matching the 'call_site=<func>' part specifically to extract
      the function name.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Reported-by: default avatarAishwarya TCV <aishwarya.tcv@arm.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: linux-trace-kernel@vger.kernel.org
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      8ecab2e6
    • Borislav Petkov (AMD)'s avatar
      x86/bugs: Fix the SRSO mitigation on Zen3/4 · 4535e1a4
      Borislav Petkov (AMD) authored
      The original version of the mitigation would patch in the calls to the
      untraining routines directly.  That is, the alternative() in UNTRAIN_RET
      will patch in the CALL to srso_alias_untrain_ret() directly.
      
      However, even if commit e7c25c44 ("x86/cpu: Cleanup the untrain
      mess") meant well in trying to clean up the situation, due to micro-
      architectural reasons, the untraining routine srso_alias_untrain_ret()
      must be the target of a CALL instruction and not of a JMP instruction as
      it is done now.
      
      Reshuffle the alternative macros to accomplish that.
      
      Fixes: e7c25c44 ("x86/cpu: Cleanup the untrain mess")
      Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
      Reviewed-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4535e1a4
    • Linus Torvalds's avatar
      Merge tag '6.9-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 · 091619ba
      Linus Torvalds authored
      Pull smb client fixes from Steve French:
      
       - Add missing trace point (noticed when debugging the recent mknod LSM
         regression)
      
       - fscache fix
      
      * tag '6.9-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Fix duplicate fscache cookie warnings
        smb3: add trace event for mknod
      091619ba
    • Linus Torvalds's avatar
      Merge tag 'thermal-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 3a3c0de6
      Linus Torvalds authored
      Pull thermal control fixes from Rafael Wysocki:
       "These revert a problematic optimization commit and address a devfreq
        cooling device issue.
      
        Specifics:
      
         - Revert thermal core optimization that introduced a functional issue
           causing a critical trip point to be crossed in some cases (Daniel
           Lezcano)
      
         - Add missing conversion between different state ranges to the
           devfreq cooling device driver (Ye Zhang)"
      
      * tag 'thermal-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        thermal: devfreq_cooling: Fix perf state when calculate dfc res_util
        Revert "thermal: core: Don't update trip points inside the hysteresis range"
      3a3c0de6
    • Linus Torvalds's avatar
      Merge tag 'acpi-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · ab317b32
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These fix two issues that may lead to attempts to use memory that has
        been freed already.
      
        Specifics:
      
         - Drop __exit annotation from einj_remove() in the ACPI APEI code
           because this function can be called during runtime (Arnd Bergmann)
      
         - Make acpi_db_walk_for_fields() check acpi_evaluate_object() return
           value to avoid accessing memory that has been freed (Nikita
           Kiryushin)"
      
      * tag 'acpi-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPICA: debugger: check status of acpi_evaluate_object() in acpi_db_walk_for_fields()
        ACPI: APEI: EINJ: mark remove callback as non-__exit
      ab317b32
    • Linus Torvalds's avatar
      mm: clean up populate_vma_page_range() FOLL_* flag handling · 1096bc93
      Linus Torvalds authored
      The code wasn't exactly wrong, but it was very odd, and it used
      FOLL_FORCE together with FOLL_WRITE when it really didn't need to (it
      only set FOLL_WRITE for writable mappings, so then the FOLL_FORCE was
      pointless).
      
      It also pointlessly called __get_user_pages() even when it knew it
      wouldn't populate anything because the vma wasn't accessible and it
      explicitly tested for and did *not* set FOLL_FORCE for inaccessible
      vma's.
      
      This code does need to use FOLL_FORCE, because we want to do fault in
      writable shared mappings, but then the mapping may not actually be
      readable.  And we don't want to use FOLL_WRITE (which would match the
      permission of the vma), because that would also dirty the pages, which
      we don't want to do.
      
      For very similar reasons, FOLL_FORCE populates a executable-only mapping
      with no read permissions. We don't have a FOLL_EXEC flag.
      
      Yes, it would probably be cleaner to split FOLL_WRITE into two bits (for
      separate permission and dirty bit handling), and add a FOLL_EXEC flag
      for the "GUP executable page" case.  That would allow us to avoid
      FOLL_FORCE entirely here.
      
      But that's not how our FOLL_xyz bits have traditionally worked, and that
      would be a much bigger patch.
      
      So this at least avoids the FOLL_FORCE | FOLL_WRITE combination that
      made one of my experimental validation patches trigger a warning.  That
      warning was a false positive (and my experimental patch was incomplete
      anyway), but it all made me look at this and decide to clean at least
      this small case up.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1096bc93
    • Rafael J. Wysocki's avatar
      Merge branch 'acpica' · 6af71633
      Rafael J. Wysocki authored
      * acpica:
        ACPICA: debugger: check status of acpi_evaluate_object() in acpi_db_walk_for_fields()
      6af71633
    • Linus Torvalds's avatar
      Merge tag 'efi-fixes-for-v6.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi · 0eee99d9
      Linus Torvalds authored
      Pull EFI fixes from Ard Biesheuvel:
       "These address all the outstanding EFI/x86 boot related regressions:
      
         - Revert to the old initrd memory allocation soft limit of INT_MAX,
           which was dropped inadvertently
      
         - Ensure that startup_32() is entered with a valid boot_params
           pointer when using the new EFI mixed mode protocol
      
         - Fix a compiler warning introduced by a fix from the previous pull"
      
      * tag 'efi-fixes-for-v6.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
        x86/efistub: Reinstate soft limit for initrd loading
        efi/libstub: Cast away type warning in use of max()
        x86/efistub: Add missing boot_params for mixed mode compat entry
      0eee99d9
    • Linus Torvalds's avatar
      Merge tag 'block-6.9-20240329' of git://git.kernel.dk/linux · 033e8088
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Small round of minor fixes or cleanups for the 6.9-rc2 kernel, one
        fixing an issue introduced in 6.8"
      
      * tag 'block-6.9-20240329' of git://git.kernel.dk/linux:
        block: Do not force full zone append completion in req_bio_endio()
        block: don't reject too large max_user_sectors in blk_validate_limits
        block: Make blk_rq_set_mixed_merge() static
      033e8088
    • Linus Torvalds's avatar
      Merge tag 'for-6.9/dm-fixes-2' of... · 3508f318
      Linus Torvalds authored
      Merge tag 'for-6.9/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper fixes from Mike Snitzer:
      
       - Fix MAINTAINERS to not include M: dm-devel for DM entries.
      
       - Fix DM vdo's murmurhash to use proper byteswapping methods.
      
       - Fix DM integrity clang warning about comparison out-of-range.
      
      * tag 'for-6.9/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm integrity: fix out-of-range warning
        dm vdo murmurhash3: use kernel byteswapping routines instead of GCC ones
        MAINTAINERS: Remove incorrect M: tag for dm-devel@lists.linux.dev
      3508f318
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · 033e4491
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
      
       - fix a procfs failure when requesting an interrupt with a label
         containing the '/' character
      
       - add missing stubs for GPIO lookup functions for !GPIOLIB
      
       - fix debug messages that would print "(null)" for NULL strings
      
      * tag 'gpio-fixes-for-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpiolib: Fix debug messaging in gpiod_find_and_request()
        gpiolib: Add stubs for GPIO lookup functions
        gpio: cdev: sanitize the label before requesting the interrupt
      033e4491
    • Arnd Bergmann's avatar
      dm integrity: fix out-of-range warning · 8e91c234
      Arnd Bergmann authored
      Depending on the value of CONFIG_HZ, clang complains about a pointless
      comparison:
      
      drivers/md/dm-integrity.c:4085:12: error: result of comparison of
                              constant 42949672950 with expression of type
                              'unsigned int' is always false
                              [-Werror,-Wtautological-constant-out-of-range-compare]
                              if (val >= (uint64_t)UINT_MAX * 1000 / HZ) {
      
      As the check remains useful for other configurations, shut up the
      warning by adding a second type cast to uint64_t.
      
      Fixes: 468dfca3 ("dm integrity: add a bitmap mode")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Reviewed-by: default avatarJustin Stitt <justinstitt@google.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      8e91c234
    • Ken Raeburn's avatar
      dm vdo murmurhash3: use kernel byteswapping routines instead of GCC ones · d7e12014
      Ken Raeburn authored
      Also open-code the calls.
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarKen Raeburn <raeburn@redhat.com>
      Signed-off-by: default avatarMatthew Sakai <msakai@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      d7e12014
    • Kuan-Wei Chiu's avatar
      MAINTAINERS: Remove incorrect M: tag for dm-devel@lists.linux.dev · 309d8ced
      Kuan-Wei Chiu authored
      The dm-devel@lists.linux.dev mailing list should only be listed under
      the L: (List) tag in the MAINTAINERS file. However, it was incorrectly
      listed under both L: and M: (Maintainers) tags, which is not accurate.
      Remove the M: tag for dm-devel@lists.linux.dev in the MAINTAINERS file
      to reflect the correct categorization.
      Signed-off-by: default avatarKuan-Wei Chiu <visitorckw@gmail.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      309d8ced
    • Linus Torvalds's avatar
      Merge tag 'mmc-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 317c7bc0
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC core:
         - Fix regression for the mmc ioctl
      
        MMC host:
         - sdhci-of-dwcmshc: Fixup PM support in ->remove_new()
         - sdhci-omap: Re-tune when device became runtime suspended"
      
      * tag 'mmc-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        sdhci-of-dwcmshc: disable PM runtime in dwcmshc_remove()
        mmc: sdhci-omap: re-tuning is needed after a pm transition to support emmc HS200 mode
        mmc: core: Avoid negative index with array access
        mmc: core: Initialize mmc_blk_ioc_data
      317c7bc0
  2. 28 Mar, 2024 21 commits
    • Damien Le Moal's avatar
      block: Do not force full zone append completion in req_bio_endio() · 55251fbd
      Damien Le Moal authored
      This reverts commit 748dc0b6.
      
      Partial zone append completions cannot be supported as there is no
      guarantees that the fragmented data will be written sequentially in the
      same manner as with a full command. Commit 748dc0b6 ("block: fix
      partial zone append completion handling in req_bio_endio()") changed
      req_bio_endio() to always advance a partially failed BIO by its full
      length, but this can lead to incorrect accounting. So revert this
      change and let low level device drivers handle this case by always
      failing completely zone append operations. With this revert, users will
      still see an IO error for a partially completed zone append BIO.
      
      Fixes: 748dc0b6 ("block: fix partial zone append completion handling in req_bio_endio()")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Link: https://lore.kernel.org/r/20240328004409.594888-2-dlemoal@kernel.orgSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
      55251fbd
    • Linus Torvalds's avatar
      Merge tag 'sound-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 529b10c0
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of device-specific small fixes: a series of fixes for
        TAS2781 HD-audio codec, ASoC SOF, Cirrus CS35L56 and a couple of
        legacy drivers"
      
      * tag 'sound-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda/tas2781: remove useless dev_dbg from playback_hook
        ALSA: hda/tas2781: add debug statements to kcontrols
        ALSA: hda/tas2781: add locks to kcontrols
        ALSA: hda/tas2781: remove digital gain kcontrol
        ALSA: aoa: avoid false-positive format truncation warning
        ALSA: sh: aica: reorder cleanup operations to avoid UAF bugs
        ALSA: hda: cs35l56: Set the init_done flag before component_add()
        ALSA: hda: cs35l56: Raise device name message log level
        ASoC: SOF: ipc4-topology: support NHLT device type
        ALSA: hda: intel-nhlt: add intel_nhlt_ssp_device_type() function
      529b10c0
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 6e7a2ffd
      Linus Torvalds authored
      Pull iommu fixes from Joerg Roedel:
       "ARM SMMU fixes:
      
         - Fix swabbing of the STE fields in the unlikely event of running on
           a big-endian machine
      
         - Fix setting of STE.SHCFG on hardware that doesn't implement support
           for attribute overrides
      
        IOMMU core:
      
         - PASID validation fix in device attach path"
      
      * tag 'iommu-fixes-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu: Validate the PASID in iommu_attach_device_pasid()
        iommu/arm-smmu-v3: Fix access for STE.SHCFG
        iommu/arm-smmu-v3: Add cpu_to_le64() around STRTAB_STE_0_V
      6e7a2ffd
    • Linus Torvalds's avatar
      Merge tag 'nfsd-6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · d8e8fbec
      Linus Torvalds authored
      Pull nfsd fixes from Chuck Lever:
      
       - Address three recently introduced regressions
      
      * tag 'nfsd-6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
        NFSD: CREATE_SESSION must never cache NFS4ERR_DELAY replies
        SUNRPC: Revert 561141dd
        nfsd: Fix error cleanup path in nfsd_rename()
      d8e8fbec
    • Linus Torvalds's avatar
      Merge tag 'net-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 50108c35
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from bpf, WiFi and netfilter.
      
        Current release - regressions:
      
         - ipv6: fix address dump when IPv6 is disabled on an interface
      
        Current release - new code bugs:
      
         - bpf: temporarily disable atomic operations in BPF arena
      
         - nexthop: fix uninitialized variable in nla_put_nh_group_stats()
      
        Previous releases - regressions:
      
         - bpf: protect against int overflow for stack access size
      
         - hsr: fix the promiscuous mode in offload mode
      
         - wifi: don't always use FW dump trig
      
         - tls: adjust recv return with async crypto and failed copy to
           userspace
      
         - tcp: properly terminate timers for kernel sockets
      
         - ice: fix memory corruption bug with suspend and rebuild
      
         - at803x: fix kernel panic with at8031_probe
      
         - qeth: handle deferred cc1
      
        Previous releases - always broken:
      
         - bpf: fix bug in BPF_LDX_MEMSX
      
         - netfilter: reject table flag and netdev basechain updates
      
         - inet_defrag: prevent sk release while still in use
      
         - wifi: pick the version of SESSION_PROTECTION_NOTIF
      
         - wwan: t7xx: split 64bit accesses to fix alignment issues
      
         - mlxbf_gige: call request_irq() after NAPI initialized
      
         - hns3: fix kernel crash when devlink reload during pf
           initialization"
      
      * tag 'net-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (81 commits)
        inet: inet_defrag: prevent sk release while still in use
        Octeontx2-af: fix pause frame configuration in GMP mode
        net: lan743x: Add set RFE read fifo threshold for PCI1x1x chips
        net: bcmasp: Remove phy_{suspend/resume}
        net: bcmasp: Bring up unimac after PHY link up
        net: phy: qcom: at803x: fix kernel panic with at8031_probe
        netfilter: arptables: Select NETFILTER_FAMILY_ARP when building arp_tables.c
        netfilter: nf_tables: skip netdev hook unregistration if table is dormant
        netfilter: nf_tables: reject table flag and netdev basechain updates
        netfilter: nf_tables: reject destroy command to remove basechain hooks
        bpf: update BPF LSM designated reviewer list
        bpf: Protect against int overflow for stack access size
        bpf: Check bloom filter map value size
        bpf: fix warning for crash_kexec
        selftests: netdevsim: set test timeout to 10 minutes
        net: wan: framer: Add missing static inline qualifiers
        mlxbf_gige: call request_irq() after NAPI initialized
        tls: get psock ref after taking rxlock to avoid leak
        selftests: tls: add test with a partially invalid iov
        tls: adjust recv return with async crypto and failed copy to userspace
        ...
      50108c35
    • David Gow's avatar
      kunit: configs: Enable CONFIG_DAMON_DBGFS_DEPRECATED for --alltests · cfedfb24
      David Gow authored
      This is required, as CONFIG_DAMON_DEBUGFS is enabled, and --alltests UML
      builds will fail due to the missing config option otherwise.
      
      Fixes: f4cba4bf ("mm/damon: rename CONFIG_DAMON_DBGFS to DAMON_DBGFS_DEPRECATED")
      Signed-off-by: default avatarDavid Gow <davidgow@google.com>
      Reviewed-by: default avatarRae Moar <rmoar@google.com>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      cfedfb24
    • Ard Biesheuvel's avatar
      x86/efistub: Reinstate soft limit for initrd loading · decd347c
      Ard Biesheuvel authored
      Commit
      
        8117961d98fb2 ("x86/efi: Disregard setup header of loaded image")
      
      dropped the memcopy of the image's setup header into the boot_params
      struct provided to the core kernel, on the basis that EFI boot does not
      need it and should rely only on a single protocol to interface with the
      boot chain. It is also a prerequisite for being able to increase the
      section alignment to 4k, which is needed to enable memory protections
      when running in the boot services.
      
      So only the setup_header fields that matter to the core kernel are
      populated explicitly, and everything else is ignored. One thing was
      overlooked, though: the initrd_addr_max field in the setup_header is not
      used by the core kernel, but it is used by the EFI stub itself when it
      loads the initrd, where its default value of INT_MAX is used as the soft
      limit for memory allocation.
      
      This means that, in the old situation, the initrd was virtually always
      loaded in the lower 2G of memory, but now, due to initrd_addr_max being
      0x0, the initrd may end up anywhere in memory. This should not be an
      issue principle, as most systems can deal with this fine. However, it
      does appear to tickle some problems in older UEFI implementations, where
      the memory ends up being corrupted, resulting in errors when unpacking
      the initramfs.
      
      So set the initrd_addr_max field to INT_MAX like it was before.
      
      Fixes: 8117961d98fb2 ("x86/efi: Disregard setup header of loaded image")
      Reported-by: default avatarRadek Podgorny <radek@podgorny.cz>
      Closes: https://lore.kernel.org/all/a99a831a-8ad5-4cb0-bff9-be637311f771@podgorny.czSigned-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      decd347c
    • Ard Biesheuvel's avatar
      efi/libstub: Cast away type warning in use of max() · 61d130f2
      Ard Biesheuvel authored
      Avoid a type mismatch warning in max() by switching to max_t() and
      providing the type explicitly.
      
      Fixes: 3cb4a482 ("efi/libstub: fix efi_random_alloc() ...")
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      61d130f2
    • Florian Westphal's avatar
      inet: inet_defrag: prevent sk release while still in use · 18685451
      Florian Westphal authored
      ip_local_out() and other functions can pass skb->sk as function argument.
      
      If the skb is a fragment and reassembly happens before such function call
      returns, the sk must not be released.
      
      This affects skb fragments reassembled via netfilter or similar
      modules, e.g. openvswitch or ct_act.c, when run as part of tx pipeline.
      
      Eric Dumazet made an initial analysis of this bug.  Quoting Eric:
        Calling ip_defrag() in output path is also implying skb_orphan(),
        which is buggy because output path relies on sk not disappearing.
      
        A relevant old patch about the issue was :
        8282f274 ("inet: frag: Always orphan skbs inside ip_defrag()")
      
        [..]
      
        net/ipv4/ip_output.c depends on skb->sk being set, and probably to an
        inet socket, not an arbitrary one.
      
        If we orphan the packet in ipvlan, then downstream things like FQ
        packet scheduler will not work properly.
      
        We need to change ip_defrag() to only use skb_orphan() when really
        needed, ie whenever frag_list is going to be used.
      
      Eric suggested to stash sk in fragment queue and made an initial patch.
      However there is a problem with this:
      
      If skb is refragmented again right after, ip_do_fragment() will copy
      head->sk to the new fragments, and sets up destructor to sock_wfree.
      IOW, we have no choice but to fix up sk_wmem accouting to reflect the
      fully reassembled skb, else wmem will underflow.
      
      This change moves the orphan down into the core, to last possible moment.
      As ip_defrag_offset is aliased with sk_buff->sk member, we must move the
      offset into the FRAG_CB, else skb->sk gets clobbered.
      
      This allows to delay the orphaning long enough to learn if the skb has
      to be queued or if the skb is completing the reasm queue.
      
      In the former case, things work as before, skb is orphaned.  This is
      safe because skb gets queued/stolen and won't continue past reasm engine.
      
      In the latter case, we will steal the skb->sk reference, reattach it to
      the head skb, and fix up wmem accouting when inet_frag inflates truesize.
      
      Fixes: 7026b1dd ("netfilter: Pass socket pointer down through okfn().")
      Diagnosed-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarxingwei lee <xrivendell7@gmail.com>
      Reported-by: default avataryue sun <samsun1006219@gmail.com>
      Reported-by: syzbot+e5167d7144a62715044c@syzkaller.appspotmail.com
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20240326101845.30836-1-fw@strlen.deSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      18685451
    • Hariprasad Kelam's avatar
      Octeontx2-af: fix pause frame configuration in GMP mode · 40d4b480
      Hariprasad Kelam authored
      The Octeontx2 MAC block (CGX) has separate data paths (SMU and GMP) for
      different speeds, allowing for efficient data transfer.
      
      The previous patch which added pause frame configuration has a bug due
      to which pause frame feature is not working in GMP mode.
      
      This patch fixes the issue by configurating appropriate registers.
      
      Fixes: f7e086e7 ("octeontx2-af: Pause frame configuration at cgx")
      Signed-off-by: default avatarHariprasad Kelam <hkelam@marvell.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/20240326052720.4441-1-hkelam@marvell.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      40d4b480
    • Raju Lakkaraju's avatar
      net: lan743x: Add set RFE read fifo threshold for PCI1x1x chips · e4a58989
      Raju Lakkaraju authored
      PCI11x1x Rev B0 devices might drop packets when receiving back to back frames
      at 2.5G link speed. Change the B0 Rev device's Receive filtering Engine FIFO
      threshold parameter from its hardware default of 4 to 3 dwords to prevent the
      problem. Rev C0 and later hardware already defaults to 3 dwords.
      
      Fixes: bb4f6bff ("net: lan743x: Add PCI11010 / PCI11414 device IDs")
      Signed-off-by: default avatarRaju Lakkaraju <Raju.Lakkaraju@microchip.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/20240326065805.686128-1-Raju.Lakkaraju@microchip.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      e4a58989
    • Paolo Abeni's avatar
      Merge branch 'net-bcmasp-phy-managements-fixes' · eb67cdb3
      Paolo Abeni authored
      Justin Chen says:
      
      ====================
      net: bcmasp: phy managements fixes
      
      Fix two issues.
      
      - The unimac may be put in a bad state if PHY RX clk doesn't exist
        during reset. Work around this by bringing the unimac out of reset
        during phy up.
      
      - Remove redundant phy_{suspend/resume}
      ====================
      
      Link: https://lore.kernel.org/r/20240325193025.1540737-1-justin.chen@broadcom.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      eb67cdb3
    • Justin Chen's avatar
      net: bcmasp: Remove phy_{suspend/resume} · 4494c10e
      Justin Chen authored
      phy_{suspend/resume} is redundant. It gets called from phy_{stop/start}.
      
      Fixes: 490cb412 ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
      Signed-off-by: default avatarJustin Chen <justin.chen@broadcom.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      4494c10e
    • Justin Chen's avatar
      net: bcmasp: Bring up unimac after PHY link up · dfd222e2
      Justin Chen authored
      The unimac requires the PHY RX clk during reset or it may be put
      into a bad state. Bring up the unimac after link up to ensure the
      PHY RX clk exists.
      
      Fixes: 490cb412 ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
      Signed-off-by: default avatarJustin Chen <justin.chen@broadcom.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      dfd222e2
    • Christian Marangi's avatar
      net: phy: qcom: at803x: fix kernel panic with at8031_probe · 6a4aee27
      Christian Marangi authored
      On reworking and splitting the at803x driver, in splitting function of
      at803x PHYs it was added a NULL dereference bug where priv is referenced
      before it's actually allocated and then is tried to write to for the
      is_1000basex and is_fiber variables in the case of at8031, writing on
      the wrong address.
      
      Fix this by correctly setting priv local variable only after
      at803x_probe is called and actually allocates priv in the phydev struct.
      Reported-by: default avatarWilliam Wortel <wwortel@dorpstraat.com>
      Cc: <stable@vger.kernel.org>
      Fixes: 25d2ba94 ("net: phy: at803x: move specific at8031 probe mode check to dedicated probe")
      Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Link: https://lore.kernel.org/r/20240325190621.2665-1-ansuelsmth@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      6a4aee27
    • Paolo Abeni's avatar
      Merge tag 'nf-24-03-28' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf · 005e528c
      Paolo Abeni authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for net:
      
      Patch #1 reject destroy chain command to delete device hooks in netdev
               family, hence, only delchain commands are allowed.
      
      Patch #2 reject table flag update interference with netdev basechain
      	 hook updates, this can leave hooks in inconsistent
      	 registration/unregistration state.
      
      Patch #3 do not unregister netdev basechain hooks if table is dormant.
      	 Otherwise, splat with double unregistration is possible.
      
      Patch #4 fixes Kconfig to allow to restore IP_NF_ARPTABLES,
      	 from Kuniyuki Iwashima.
      
      There are a more fixes still in progress on my side that need more work.
      
      * tag 'nf-24-03-28' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf:
        netfilter: arptables: Select NETFILTER_FAMILY_ARP when building arp_tables.c
        netfilter: nf_tables: skip netdev hook unregistration if table is dormant
        netfilter: nf_tables: reject table flag and netdev basechain updates
        netfilter: nf_tables: reject destroy command to remove basechain hooks
      ====================
      
      Link: https://lore.kernel.org/r/20240328031855.2063-1-pablo@netfilter.orgSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      005e528c
    • Paolo Abeni's avatar
      Merge tag 'for-net' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 7e6f4b2a
      Paolo Abeni authored
      Alexei Starovoitov says:
      
      ====================
      pull-request: bpf 2024-03-27
      
      The following pull-request contains BPF updates for your *net* tree.
      
      We've added 4 non-merge commits during the last 1 day(s) which contain
      a total of 5 files changed, 26 insertions(+), 3 deletions(-).
      
      The main changes are:
      
      1) Fix bloom filter value size validation and protect the verifier
         against such mistakes, from Andrei.
      
      2) Fix build due to CONFIG_KEXEC_CORE/CRASH_DUMP split, from Hari.
      
      3) Update bpf_lsm maintainers entry, from Matt.
      
      * tag 'for-net' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
        bpf: update BPF LSM designated reviewer list
        bpf: Protect against int overflow for stack access size
        bpf: Check bloom filter map value size
        bpf: fix warning for crash_kexec
      ====================
      
      Link: https://lore.kernel.org/r/20240328012938.24249-1-alexei.starovoitov@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      7e6f4b2a
    • Jason Gunthorpe's avatar
      iommu: Validate the PASID in iommu_attach_device_pasid() · c404f55c
      Jason Gunthorpe authored
      The SVA code checks that the PASID is valid for the device when assigning
      the PASID to the MM, but the normal PAGING related path does not check it.
      
      Devices that don't support PASID or PASID values too large for the device
      should not invoke the driver callback. The drivers should rely on the
      core code for this enforcement.
      
      Fixes: 16603704 ("iommu: Add attach/detach_dev_pasid iommu interfaces")
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Reviewed-by: default avatarYi Liu <yi.l.liu@intel.com>
      Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
      Link: https://lore.kernel.org/r/0-v1-460705442b30+659-iommu_check_pasid_jgg@nvidia.comSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      c404f55c
    • Joerg Roedel's avatar
      Merge tag 'arm-smmu-fixes' of... · 25685960
      Joerg Roedel authored
      Merge tag 'arm-smmu-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into iommu/fixes
      
      Arm SMMU fixes for 6.9
      
      - Fix swabbing of the STE fields in the unlikely event of running on a
        big-endian machine.
      
      - Fix setting of STE.SHCFG on hardware that doesn't implement support
        for attribute overrides.
      25685960
    • Linus Torvalds's avatar
      Merge tag 'erofs-for-6.9-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs · 8d025e20
      Linus Torvalds authored
      Pull erofs fixes from Gao Xiang:
      
       - Add a new reviewer Sandeep Dhavale to build a healthier community
      
       - Drop experimental warning for FSDAX
      
      * tag 'erofs-for-6.9-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
        MAINTAINERS: erofs: add myself as reviewer
        erofs: drop experimental warning for FSDAX
      8d025e20
    • Kuniyuki Iwashima's avatar
      netfilter: arptables: Select NETFILTER_FAMILY_ARP when building arp_tables.c · 15fba562
      Kuniyuki Iwashima authored
      syzkaller started to report a warning below [0] after consuming the
      commit 4654467d ("netfilter: arptables: allow xtables-nft only
      builds").
      
      The change accidentally removed the dependency on NETFILTER_FAMILY_ARP
      from IP_NF_ARPTABLES.
      
      If NF_TABLES_ARP is not enabled on Kconfig, NETFILTER_FAMILY_ARP will
      be removed and some code necessary for arptables will not be compiled.
      
        $ grep -E "(NETFILTER_FAMILY_ARP|IP_NF_ARPTABLES|NF_TABLES_ARP)" .config
        CONFIG_NETFILTER_FAMILY_ARP=y
        # CONFIG_NF_TABLES_ARP is not set
        CONFIG_IP_NF_ARPTABLES=y
      
        $ make olddefconfig
      
        $ grep -E "(NETFILTER_FAMILY_ARP|IP_NF_ARPTABLES|NF_TABLES_ARP)" .config
        # CONFIG_NF_TABLES_ARP is not set
        CONFIG_IP_NF_ARPTABLES=y
      
      So, when nf_register_net_hooks() is called for arptables, it will
      trigger the splat below.
      
      Now IP_NF_ARPTABLES is only enabled by IP_NF_ARPFILTER, so let's
      restore the dependency on NETFILTER_FAMILY_ARP in IP_NF_ARPFILTER.
      
      [0]:
      WARNING: CPU: 0 PID: 242 at net/netfilter/core.c:316 nf_hook_entry_head+0x1e1/0x2c0 net/netfilter/core.c:316
      Modules linked in:
      CPU: 0 PID: 242 Comm: syz-executor.0 Not tainted 6.8.0-12821-g537c2e91 #10
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
      RIP: 0010:nf_hook_entry_head+0x1e1/0x2c0 net/netfilter/core.c:316
      Code: 83 fd 04 0f 87 bc 00 00 00 e8 5b 84 83 fd 4d 8d ac ec a8 0b 00 00 e8 4e 84 83 fd 4c 89 e8 5b 5d 41 5c 41 5d c3 e8 3f 84 83 fd <0f> 0b e8 38 84 83 fd 45 31 ed 5b 5d 4c 89 e8 41 5c 41 5d c3 e8 26
      RSP: 0018:ffffc90000b8f6e8 EFLAGS: 00010293
      RAX: 0000000000000000 RBX: 0000000000000003 RCX: ffffffff83c42164
      RDX: ffff888106851180 RSI: ffffffff83c42321 RDI: 0000000000000005
      RBP: 0000000000000000 R08: 0000000000000005 R09: 000000000000000a
      R10: 0000000000000003 R11: ffff8881055c2f00 R12: ffff888112b78000
      R13: 0000000000000000 R14: ffff8881055c2f00 R15: ffff8881055c2f00
      FS:  00007f377bd78800(0000) GS:ffff88811b000000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000496068 CR3: 000000011298b003 CR4: 0000000000770ef0
      PKRU: 55555554
      Call Trace:
       <TASK>
       __nf_register_net_hook+0xcd/0x7a0 net/netfilter/core.c:428
       nf_register_net_hook+0x116/0x170 net/netfilter/core.c:578
       nf_register_net_hooks+0x5d/0xc0 net/netfilter/core.c:594
       arpt_register_table+0x250/0x420 net/ipv4/netfilter/arp_tables.c:1553
       arptable_filter_table_init+0x41/0x60 net/ipv4/netfilter/arptable_filter.c:39
       xt_find_table_lock+0x2e9/0x4b0 net/netfilter/x_tables.c:1260
       xt_request_find_table_lock+0x2b/0xe0 net/netfilter/x_tables.c:1285
       get_info+0x169/0x5c0 net/ipv4/netfilter/arp_tables.c:808
       do_arpt_get_ctl+0x3f9/0x830 net/ipv4/netfilter/arp_tables.c:1444
       nf_getsockopt+0x76/0xd0 net/netfilter/nf_sockopt.c:116
       ip_getsockopt+0x17d/0x1c0 net/ipv4/ip_sockglue.c:1777
       tcp_getsockopt+0x99/0x100 net/ipv4/tcp.c:4373
       do_sock_getsockopt+0x279/0x360 net/socket.c:2373
       __sys_getsockopt+0x115/0x1e0 net/socket.c:2402
       __do_sys_getsockopt net/socket.c:2412 [inline]
       __se_sys_getsockopt net/socket.c:2409 [inline]
       __x64_sys_getsockopt+0xbd/0x150 net/socket.c:2409
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0x4f/0x110 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x46/0x4e
      RIP: 0033:0x7f377beca6fe
      Code: 1f 44 00 00 48 8b 15 01 97 0a 00 f7 d8 64 89 02 b8 ff ff ff ff eb b8 0f 1f 44 00 00 f3 0f 1e fa 49 89 ca b8 37 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 0a c3 66 0f 1f 84 00 00 00 00 00 48 8b 15 c9
      RSP: 002b:00000000005df728 EFLAGS: 00000246 ORIG_RAX: 0000000000000037
      RAX: ffffffffffffffda RBX: 00000000004966e0 RCX: 00007f377beca6fe
      RDX: 0000000000000060 RSI: 0000000000000000 RDI: 0000000000000003
      RBP: 000000000042938a R08: 00000000005df73c R09: 00000000005df800
      R10: 00000000004966e8 R11: 0000000000000246 R12: 0000000000000003
      R13: 0000000000496068 R14: 0000000000000003 R15: 00000000004bc9d8
       </TASK>
      
      Fixes: 4654467d ("netfilter: arptables: allow xtables-nft only builds")
      Reported-by: default avatarsyzkaller <syzkaller@googlegroups.com>
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      15fba562