Skip to content
  1. Mar 26, 2024
  2. Mar 25, 2024
  3. Mar 20, 2024
  4. Mar 14, 2024
  5. Mar 13, 2024
    • Jakub Kicinski's avatar
      Merge branch 'tcp-rds-fix-use-after-free-around-kernel-tcp-reqsk' · 67072c31
      Jakub Kicinski authored
      Kuniyuki Iwashima says:
      
      ====================
      tcp/rds: Fix use-after-free around kernel TCP reqsk.
      
      syzkaller reported an warning of netns ref tracker for RDS TCP listener,
      which commit 740ea3c4 ("tcp: Clean up kernel listener's reqsk in
      inet_twsk_purge()") fixed for per-netns ehash.
      
      This series fixes the bug in the partial fix and fixes the reported bug
      in the global ehash.
      
      v4: https://lore.kernel.org/netdev/20240307232151.55963-1-kuniyu@amazon.com/
      v3: https://lore.kernel.org/netdev/20240307224423.53315-1-kuniyu@amazon.com/
      v2: https://lore.kernel.org/netdev/20240227011041.97375-1-kuniyu@amazon.com/
      v1: https://lore.kernel.org/netdev/20240223172448.94084-1-kuniyu@amazon.com/
      ====================
      
      Link: https://lore.kernel.org/r/20240308200122.64357-1-kuniyu@amazon.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      67072c31
    • Kuniyuki Iwashima's avatar
      rds: tcp: Fix use-after-free of net in reqsk_timer_handler(). · 2a750d6a
      Kuniyuki Iwashima authored
      
      
      syzkaller reported a warning of netns tracker [0] followed by KASAN
      splat [1] and another ref tracker warning [1].
      
      syzkaller could not find a repro, but in the log, the only suspicious
      sequence was as follows:
      
        18:26:22 executing program 1:
        r0 = socket$inet6_mptcp(0xa, 0x1, 0x106)
        ...
        connect$inet6(r0, &(0x7f0000000080)={0xa, 0x4001, 0x0, @loopback}, 0x1c) (async)
      
      The notable thing here is 0x4001 in connect(), which is RDS_TCP_PORT.
      
      So, the scenario would be:
      
        1. unshare(CLONE_NEWNET) creates a per netns tcp listener in
            rds_tcp_listen_init().
        2. syz-executor connect()s to it and creates a reqsk.
        3. syz-executor exit()s immediately.
        4. netns is dismantled.  [0]
        5. reqsk timer is fired, and UAF happens while freeing reqsk.  [1]
        6. listener is freed after RCU grace period.  [2]
      
      Basically, reqsk assumes that the listener guarantees netns safety
      until all reqsk timers are expired by holding the listener's refcount.
      However, this was not the case for kernel sockets.
      
      Commit 740ea3c4 ("tcp: Clean up kernel listener's reqsk in
      inet_twsk_purge()") fixed this issue only for per-netns ehash.
      
      Let's apply the same fix for the global ehash.
      
      [0]:
      ref_tracker: net notrefcnt@0000000065449cc3 has 1/1 users at
           sk_alloc (./include/net/net_namespace.h:337 net/core/sock.c:2146)
           inet6_create (net/ipv6/af_inet6.c:192 net/ipv6/af_inet6.c:119)
           __sock_create (net/socket.c:1572)
           rds_tcp_listen_init (net/rds/tcp_listen.c:279)
           rds_tcp_init_net (net/rds/tcp.c:577)
           ops_init (net/core/net_namespace.c:137)
           setup_net (net/core/net_namespace.c:340)
           copy_net_ns (net/core/net_namespace.c:497)
           create_new_namespaces (kernel/nsproxy.c:110)
           unshare_nsproxy_namespaces (kernel/nsproxy.c:228 (discriminator 4))
           ksys_unshare (kernel/fork.c:3429)
           __x64_sys_unshare (kernel/fork.c:3496)
           do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83)
           entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:129)
      ...
      WARNING: CPU: 0 PID: 27 at lib/ref_tracker.c:179 ref_tracker_dir_exit (lib/ref_tracker.c:179)
      
      [1]:
      BUG: KASAN: slab-use-after-free in inet_csk_reqsk_queue_drop (./include/net/inet_hashtables.h:180 net/ipv4/inet_connection_sock.c:952 net/ipv4/inet_connection_sock.c:966)
      Read of size 8 at addr ffff88801b370400 by task swapper/0/0
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
      Call Trace:
       <IRQ>
       dump_stack_lvl (lib/dump_stack.c:107 (discriminator 1))
       print_report (mm/kasan/report.c:378 mm/kasan/report.c:488)
       kasan_report (mm/kasan/report.c:603)
       inet_csk_reqsk_queue_drop (./include/net/inet_hashtables.h:180 net/ipv4/inet_connection_sock.c:952 net/ipv4/inet_connection_sock.c:966)
       reqsk_timer_handler (net/ipv4/inet_connection_sock.c:979 net/ipv4/inet_connection_sock.c:1092)
       call_timer_fn (./arch/x86/include/asm/jump_label.h:27 ./include/linux/jump_label.h:207 ./include/trace/events/timer.h:127 kernel/time/timer.c:1701)
       __run_timers.part.0 (kernel/time/timer.c:1752 kernel/time/timer.c:2038)
       run_timer_softirq (kernel/time/timer.c:2053)
       __do_softirq (./arch/x86/include/asm/jump_label.h:27 ./include/linux/jump_label.h:207 ./include/trace/events/irq.h:142 kernel/softirq.c:554)
       irq_exit_rcu (kernel/softirq.c:427 kernel/softirq.c:632 kernel/softirq.c:644)
       sysvec_apic_timer_interrupt (arch/x86/kernel/apic/apic.c:1076 (discriminator 14))
       </IRQ>
      
      Allocated by task 258 on cpu 0 at 83.612050s:
       kasan_save_stack (mm/kasan/common.c:48)
       kasan_save_track (mm/kasan/common.c:68)
       __kasan_slab_alloc (mm/kasan/common.c:343)
       kmem_cache_alloc (mm/slub.c:3813 mm/slub.c:3860 mm/slub.c:3867)
       copy_net_ns (./include/linux/slab.h:701 net/core/net_namespace.c:421 net/core/net_namespace.c:480)
       create_new_namespaces (kernel/nsproxy.c:110)
       unshare_nsproxy_namespaces (kernel/nsproxy.c:228 (discriminator 4))
       ksys_unshare (kernel/fork.c:3429)
       __x64_sys_unshare (kernel/fork.c:3496)
       do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83)
       entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:129)
      
      Freed by task 27 on cpu 0 at 329.158864s:
       kasan_save_stack (mm/kasan/common.c:48)
       kasan_save_track (mm/kasan/common.c:68)
       kasan_save_free_info (mm/kasan/generic.c:643)
       __kasan_slab_free (mm/kasan/common.c:265)
       kmem_cache_free (mm/slub.c:4299 mm/slub.c:4363)
       cleanup_net (net/core/net_namespace.c:456 net/core/net_namespace.c:446 net/core/net_namespace.c:639)
       process_one_work (kernel/workqueue.c:2638)
       worker_thread (kernel/workqueue.c:2700 kernel/workqueue.c:2787)
       kthread (kernel/kthread.c:388)
       ret_from_fork (arch/x86/kernel/process.c:153)
       ret_from_fork_asm (arch/x86/entry/entry_64.S:250)
      
      The buggy address belongs to the object at ffff88801b370000
       which belongs to the cache net_namespace of size 4352
      The buggy address is located 1024 bytes inside of
       freed 4352-byte region [ffff88801b370000, ffff88801b371100)
      
      [2]:
      WARNING: CPU: 0 PID: 95 at lib/ref_tracker.c:228 ref_tracker_free (lib/ref_tracker.c:228 (discriminator 1))
      Modules linked in:
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
      RIP: 0010:ref_tracker_free (lib/ref_tracker.c:228 (discriminator 1))
      ...
      Call Trace:
      <IRQ>
       __sk_destruct (./include/net/net_namespace.h:353 net/core/sock.c:2204)
       rcu_core (./arch/x86/include/asm/preempt.h:26 kernel/rcu/tree.c:2165 kernel/rcu/tree.c:2433)
       __do_softirq (./arch/x86/include/asm/jump_label.h:27 ./include/linux/jump_label.h:207 ./include/trace/events/irq.h:142 kernel/softirq.c:554)
       irq_exit_rcu (kernel/softirq.c:427 kernel/softirq.c:632 kernel/softirq.c:644)
       sysvec_apic_timer_interrupt (arch/x86/kernel/apic/apic.c:1076 (discriminator 14))
      </IRQ>
      
      Reported-by: default avatarsyzkaller <syzkaller@googlegroups.com>
      Suggested-by: default avatarEric Dumazet <edumazet@google.com>
      Fixes: 467fa153 ("RDS-TCP: Support multiple RDS-TCP listen endpoints, one per netns.")
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20240308200122.64357-3-kuniyu@amazon.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2a750d6a
    • Eric Dumazet's avatar
      tcp: Fix NEW_SYN_RECV handling in inet_twsk_purge() · 1c4e97dd
      Eric Dumazet authored
      inet_twsk_purge() uses rcu to find TIME_WAIT and NEW_SYN_RECV
      objects to purge.
      
      These objects use SLAB_TYPESAFE_BY_RCU semantic and need special
      care. We need to use refcount_inc_not_zero(&sk->sk_refcnt).
      
      Reuse the existing correct logic I wrote for TIME_WAIT,
      because both structures have common locations for
      sk_state, sk_family, and netns pointer.
      
      If after the refcount_inc_not_zero() the object fields longer match
      the keys, use sock_gen_put(sk) to release the refcount.
      
      Then we can call inet_twsk_deschedule_put() for TIME_WAIT,
      inet_csk_reqsk_queue_drop_and_put() for NEW_SYN_RECV sockets,
      with BH disabled.
      
      Then we need to restart the loop because we had drop rcu_read_lock().
      
      Fixes: 740ea3c4 ("tcp: Clean up kernel listener's reqsk in inet_twsk_purge()")
      Link: https://lore.kernel.org/netdev/CANn89iLvFuuihCtt9PME2uS1WJATnf5fKjDToa1WzVnRzHnPfg@mail.gmail.com/T/#u
      
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20240308200122.64357-2-kuniyu@amazon.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1c4e97dd
    • Linus Torvalds's avatar
      Merge tag 'net-next-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next · 9187210e
      Linus Torvalds authored
      Pull networking updates from Jakub Kicinski:
       "Core & protocols:
      
         - Large effort by Eric to lower rtnl_lock pressure and remove locks:
      
            - Make commonly used parts of rtnetlink (address, route dumps
              etc) lockless, protected by RCU instead of rtnl_lock.
      
            - Add a netns exit callback which already holds rtnl_lock,
              allowing netns exit to take rtnl_lock once in the core instead
              of once for each driver / callback.
      
            - Remove locks / serialization in the socket diag interface.
      
            - Remove 6 calls to synchronize_rcu() while holding rtnl_lock.
      
            - Remove the dev_base_lock, depend on RCU where necessary.
      
         - Support busy polling on a per-epoll context basis. Poll length and
           budget parameters can be set independently of system defaults.
      
         - Introduce struct net_hotdata, to make sure read-mostly global
           config variables fit in as few cache lines as possible.
      
         - Add optional per-nexthop statistics to ease monitoring / debug of
           ECMP imbalance problems.
      
         - Support TCP_NOTSENT_LOWAT in MPTCP.
      
         - Ensure that IPv6 temporary addresses' preferred lifetimes are long
           enough, compared to other configured lifetimes, and at least 2 sec.
      
         - Support forwarding of ICMP Error messages in IPSec, per RFC 4301.
      
         - Add support for the independent control state machine for bonding
           per IEEE 802.1AX-2008 5.4.15 in addition to the existing coupled
           control state machine.
      
         - Add "network ID" to MCTP socket APIs to support hosts with multiple
           disjoint MCTP networks.
      
         - Re-use the mono_delivery_time skbuff bit for packets which user
           space wants to be sent at a specified time. Maintain the timing
           information while traversing veth links, bridge etc.
      
         - Take advantage of MSG_SPLICE_PAGES for RxRPC DATA and ACK packets.
      
         - Simplify many places iterating over netdevs by using an xarray
           instead of a hash table walk (hash table remains in place, for use
           on fastpaths).
      
         - Speed up scanning for expired routes by keeping a dedicated list.
      
         - Speed up "generic" XDP by trying harder to avoid large allocations.
      
         - Support attaching arbitrary metadata to netconsole messages.
      
        Things we sprinkled into general kernel code:
      
         - Enforce VM_IOREMAP flag and range in ioremap_page_range and
           introduce VM_SPARSE kind and vm_area_[un]map_pages (used by
           bpf_arena).
      
         - Rework selftest harness to enable the use of the full range of ksft
           exit code (pass, fail, skip, xfail, xpass).
      
        Netfilter:
      
         - Allow userspace to define a table that is exclusively owned by a
           daemon (via netlink socket aliveness) without auto-removing this
           table when the userspace program exits. Such table gets marked as
           orphaned and a restarting management daemon can re-attach/regain
           ownership.
      
         - Speed up element insertions to nftables' concatenated-ranges set
           type. Compact a few related data structures.
      
        BPF:
      
         - Add BPF token support for delegating a subset of BPF subsystem
           functionality from privileged system-wide daemons such as systemd
           through special mount options for userns-bound BPF fs to a trusted
           & unprivileged application.
      
         - Introduce bpf_arena which is sparse shared memory region between
           BPF program and user space where structures inside the arena can
           have pointers to other areas of the arena, and pointers work
           seamlessly for both user-space programs and BPF programs.
      
         - Introduce may_goto instruction that is a contract between the
           verifier and the program. The verifier allows the program to loop
           assuming it's behaving well, but reserves the right to terminate
           it.
      
         - Extend the BPF verifier to enable static subprog calls in spin lock
           critical sections.
      
         - Support registration of struct_ops types from modules which helps
           projects like fuse-bpf that seeks to implement a new struct_ops
           type.
      
         - Add support for retrieval of cookies for perf/kprobe multi links.
      
         - Support arbitrary TCP SYN cookie generation / validation in the TC
           layer with BPF to allow creating SYN flood handling in BPF
           firewalls.
      
         - Add code generation to inline the bpf_kptr_xchg() helper which
           improves performance when stashing/popping the allocated BPF
           objects.
      
        Wireless:
      
         - Add SPP (signaling and payload protected) AMSDU support.
      
         - Support wider bandwidth OFDMA, as required for EHT operation.
      
        Driver API:
      
         - Major overhaul of the Energy Efficient Ethernet internals to
           support new link modes (2.5GE, 5GE), share more code between
           drivers (especially those using phylib), and encourage more
           uniform behavior. Convert and clean up drivers.
      
         - Define an API for querying per netdev queue statistics from
           drivers.
      
         - IPSec: account in global stats for fully offloaded sessions.
      
         - Create a concept of Ethernet PHY Packages at the Device Tree level,
           to allow parameterizing the existing PHY package code.
      
         - Enable Rx hashing (RSS) on GTP protocol fields.
      
        Misc:
      
         - Improvements and refactoring all over networking selftests.
      
         - Create uniform module aliases for TC classifiers, actions, and
           packet schedulers to simplify creating modprobe policies.
      
         - Address all missing MODULE_DESCRIPTION() warnings in networking.
      
         - Extend the Netlink descriptions in YAML to cover message
           encapsulation or "Netlink polymorphism", where interpretation of
           nested attributes depends on link type, classifier type or some
           other "class type".
      
        Drivers:
      
         - Ethernet high-speed NICs:
            - Add a new driver for Marvell's Octeon PCI Endpoint NIC VF.
            - Intel (100G, ice, idpf):
               - support E825-C devices
            - nVidia/Mellanox:
               - support devices with one port and multiple PCIe links
            - Broadcom (bnxt):
               - support n-tuple filters
               - support configuring the RSS key
            - Wangxun (ngbe/txgbe):
               - implement irq_domain for TXGBE's sub-interrupts
            - Pensando/AMD:
               - support XDP
               - optimize queue submission and wakeup handling (+17% bps)
               - optimize struct layout, saving 28% of memory on queues
      
         - Ethernet NICs embedded and virtual:
            - Google cloud vNIC:
               - refactor driver to perform memory allocations for new queue
                 config before stopping and freeing the old queue memory
            - Synopsys (stmmac):
               - obey queueMaxSDU and implement counters required by 802.1Qbv
            - Renesas (ravb):
               - support packet checksum offload
               - suspend to RAM and runtime PM support
      
         - Ethernet switches:
            - nVidia/Mellanox:
               - support for nexthop group statistics
            - Microchip:
               - ksz8: implement PHY loopback
               - add support for KSZ8567, a 7-port 10/100Mbps switch
      
         - PTP:
            - New driver for RENESAS FemtoClock3 Wireless clock generator.
            - Support OCP PTP cards designed and built by Adva.
      
         - CAN:
            - Support recvmsg() flags for own, local and remote traffic on CAN
              BCM sockets.
            - Support for esd GmbH PCIe/402 CAN device family.
            - m_can:
               - Rx/Tx submission coalescing
               - wake on frame Rx
      
         - WiFi:
            - Intel (iwlwifi):
               - enable signaling and payload protected A-MSDUs
               - support wider-bandwidth OFDMA
               - support for new devices
               - bump FW API to 89 for AX devices; 90 for BZ/SC devices
            - MediaTek (mt76):
               - mt7915: newer ADIE version support
               - mt7925: radio temperature sensor support
            - Qualcomm (ath11k):
               - support 6 GHz station power modes: Low Power Indoor (LPI),
                 Standard Power) SP and Very Low Power (VLP)
               - QCA6390 & WCN6855: support 2 concurrent station interfaces
               - QCA2066 support
            - Qualcomm (ath12k):
               - refactoring in preparation for Multi-Link Operation (MLO)
                 support
               - 1024 Block Ack window size support
               - firmware-2.bin support
               - support having multiple identical PCI devices (firmware needs
                 to have ATH12K_FW_FEATURE_MULTI_QRTR_ID)
               - QCN9274: support split-PHY devices
               - WCN7850: enable Power Save Mode in station mode
               - WCN7850: P2P support
            - RealTek:
               - rtw88: support for more rtw8811cu and rtw8821cu devices
               - rtw89: support SCAN_RANDOM_SN and SET_SCAN_DWELL
               - rtlwifi: speed up USB firmware initialization
               - rtwl8xxxu:
                   - RTL8188F: concurrent interface support
                   - Channel Switch Announcement (CSA) support in AP mode
            - Broadcom (brcmfmac):
               - per-vendor feature support
               - per-vendor SAE password setup
               - DMI nvram filename quirk for ACEPC W5 Pro"
      
      * tag 'net-next-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2255 commits)
        nexthop: Fix splat with CONFIG_DEBUG_PREEMPT=y
        nexthop: Fix out-of-bounds access during attribute validation
        nexthop: Only parse NHA_OP_FLAGS for dump messages that require it
        nexthop: Only parse NHA_OP_FLAGS for get messages that require it
        bpf: move sleepable flag from bpf_prog_aux to bpf_prog
        bpf: hardcode BPF_PROG_PACK_SIZE to 2MB * num_possible_nodes()
        selftests/bpf: Add kprobe multi triggering benchmarks
        ptp: Move from simple ida to xarray
        vxlan: Remove generic .ndo_get_stats64
        vxlan: Do not alloc tstats manually
        devlink: Add comments to use netlink gen tool
        nfp: flower: handle acti_netdevs allocation failure
        net/packet: Add getsockopt support for PACKET_COPY_THRESH
        net/netlink: Add getsockopt support for NETLINK_LISTEN_ALL_NSID
        selftests/bpf: Add bpf_arena_htab test.
        selftests/bpf: Add bpf_arena_list test.
        selftests/bpf: Add unit tests for bpf_arena_alloc/free_pages
        bpf: Add helper macro bpf_addr_space_cast()
        libbpf: Recognize __arena global variables.
        bpftool: Recognize arena map type
        ...
      9187210e
    • Linus Torvalds's avatar
      Merge tag 'docs-6.9' of git://git.lwn.net/linux · 1f440397
      Linus Torvalds authored
      Pull documentation updates from Jonathan Corbet:
       "A moderatly busy cycle for development this time around.
      
         - Some cleanup of the main index page for easier navigation
      
         - Rework some of the other top-level pages for better readability
           and, with luck, fewer merge conflicts in the future.
      
         - Submit-checklist improvements, hopefully the first of many.
      
         - New Italian translations
      
         - A fair number of kernel-doc fixes and improvements. We have also
           dropped the recommendation to use an old version of Sphinx.
      
         - A new document from Thorsten on bisection
      
        ... and lots of fixes and updates"
      
      * tag 'docs-6.9' of git://git.lwn.net/linux: (54 commits)
        docs: verify/bisect: fixes, finetuning, and support for Arch
        docs: Makefile: Add dependency to $(YNL_INDEX) for targets other than htmldocs
        docs: Move ja_JP/howto.rst to ja_JP/process/howto.rst
        docs: submit-checklist: use subheadings
        docs: submit-checklist: structure by category
        docs: new text on bisecting which also covers bug validation
        docs: drop the version constraints for sphinx and dependencies
        docs: kerneldoc-preamble.sty: Remove code for Sphinx <2.4
        docs: Restore "smart quotes" for quotes
        docs/zh_CN: accurate translation of "function"
        docs: Include simplified link titles in main index
        docs: Correct formatting of title in admin-guide/index.rst
        docs: kernel_feat.py: fix build error for missing files
        MAINTAINERS: Set the field name for subsystem profile section
        kasan: Add documentation for CONFIG_KASAN_EXTRA_INFO
        Fixed case issue with 'fault-injection' in documentation
        kernel-doc: handle #if in enums as well
        Documentation: update mailing list addresses
        doc: kerneldoc.py: fix indentation
        scripts/kernel-doc: simplify signature printing
        ...
      1f440397
    • Linus Torvalds's avatar
      Merge tag 'audit-pr-20240312' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit · 3749bda2
      Linus Torvalds authored
      Pull audit updates from Paul Moore:
       "Two small audit patches:
      
         - Use the KMEM_CACHE() macro instead of kmem_cache_create()
      
           The guidance appears to be to use the KMEM_CACHE() macro when
           possible and there is no reason why we can't use the macro, so
           let's use it.
      
         - Remove an unnecessary assignment in audit_dupe_lsm_field()
      
           A return value variable was assigned a value in its declaration,
           but the declaration value is overwritten before the return value
           variable is ever referenced; drop the assignment at declaration
           time"
      
      * tag 'audit-pr-20240312' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit:
        audit: use KMEM_CACHE() instead of kmem_cache_create()
        audit: remove unnecessary assignment in audit_dupe_lsm_field()
      3749bda2
    • Linus Torvalds's avatar
      Merge tag 'Smack-for-6.9' of https://github.com/cschaufler/smack-next · 681ba318
      Linus Torvalds authored
      Pull smack updates from Casey Schaufler:
      
       - Improvements to the initialization of in-memory inodes
      
       - A fix in ramfs to propery ensure the initialization of in-memory
         inodes
      
       - Removal of duplicated code in smack_cred_transfer()
      
      * tag 'Smack-for-6.9' of https://github.com/cschaufler/smack-next:
        Smack: use init_task_smack() in smack_cred_transfer()
        ramfs: Initialize security of in-memory inodes
        smack: Initialize the in-memory inode in smack_inode_init_security()
        smack: Always determine inode labels in smack_inode_init_security()
        smack: Handle SMACK64TRANSMUTE in smack_inode_setsecurity()
        smack: Set SMACK64TRANSMUTE only for dirs in smack_inode_setxattr()
      681ba318
    • Linus Torvalds's avatar
      Merge tag 'seccomp-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 7f1a2774
      Linus Torvalds authored
      Pull seccomp updates from Kees Cook:
       "There are no core kernel changes here; it's entirely selftests and
        samples:
      
         - Improve reliability of selftests (Terry Tritton, Kees Cook)
      
         - Fix strict-aliasing warning in samples (Arnd Bergmann)"
      
      * tag 'seccomp-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        samples: user-trap: fix strict-aliasing warning
        selftests/seccomp: Pin benchmark to single CPU
        selftests/seccomp: user_notification_addfd check nextfd is available
        selftests/seccomp: Change the syscall used in KILL_THREAD test
        selftests/seccomp: Handle EINVAL on unshare(CLONE_NEWPID)
      7f1a2774
    • Linus Torvalds's avatar
      Merge tag 'hardening-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 216532e1
      Linus Torvalds authored
      Pull hardening updates from Kees Cook:
       "As is pretty normal for this tree, there are changes all over the
        place, especially for small fixes, selftest improvements, and improved
        macro usability.
      
        Some header changes ended up landing via this tree as they depended on
        the string header cleanups. Also, a notable set of changes is the work
        for the reintroduction of the UBSAN signed integer overflow sanitizer
        so that we can continue to make improvements on the compiler side to
        make this sanitizer a more viable future security hardening option.
      
        Summary:
      
         - string.h and related header cleanups (Tanzir Hasan, Andy
           Shevchenko)
      
         - VMCI memcpy() usage and struct_size() cleanups (Vasiliy Kovalev,
           Harshit Mogalapalli)
      
         - selftests/powerpc: Fix load_unaligned_zeropad build failure
           (Michael Ellerman)
      
         - hardened Kconfig fragment updates (Marco Elver, Lukas Bulwahn)
      
         - Handle tail call optimization better in LKDTM (Douglas Anderson)
      
         - Use long form types in overflow.h (Andy Shevchenko)
      
         - Add flags param to string_get_size() (Andy Shevchenko)
      
         - Add Coccinelle script for potential struct_size() use (Jacob
           Keller)
      
         - Fix objtool corner case under KCFI (Josh Poimboeuf)
      
         - Drop 13 year old backward compat CAP_SYS_ADMIN check (Jingzi Meng)
      
         - Add str_plural() helper (Michal Wajdeczko, Kees Cook)
      
         - Ignore relocations in .notes section
      
         - Add comments to explain how __is_constexpr() works
      
         - Fix m68k stack alignment expectations in stackinit Kunit test
      
         - Convert string selftests to KUnit
      
         - Add KUnit tests for fortified string functions
      
         - Improve reporting during fortified string warnings
      
         - Allow non-type arg to type_max() and type_min()
      
         - Allow strscpy() to be called with only 2 arguments
      
         - Add binary mode to leaking_addresses scanner
      
         - Various small cleanups to leaking_addresses scanner
      
         - Adding wrapping_*() arithmetic helper
      
         - Annotate initial signed integer wrap-around in refcount_t
      
         - Add explicit UBSAN section to MAINTAINERS
      
         - Fix UBSAN self-test warnings
      
         - Simplify UBSAN build via removal of CONFIG_UBSAN_SANITIZE_ALL
      
         - Reintroduce UBSAN's signed overflow sanitizer"
      
      * tag 'hardening-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: (51 commits)
        selftests/powerpc: Fix load_unaligned_zeropad build failure
        string: Convert helpers selftest to KUnit
        string: Convert selftest to KUnit
        sh: Fix build with CONFIG_UBSAN=y
        compiler.h: Explain how __is_constexpr() works
        overflow: Allow non-type arg to type_max() and type_min()
        VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler()
        lib/string_helpers: Add flags param to string_get_size()
        x86, relocs: Ignore relocations in .notes section
        objtool: Fix UNWIND_HINT_{SAVE,RESTORE} across basic blocks
        overflow: Use POD in check_shl_overflow()
        lib: stackinit: Adjust target string to 8 bytes for m68k
        sparc: vdso: Disable UBSAN instrumentation
        kernel.h: Move lib/cmdline.c prototypes to string.h
        leaking_addresses: Provide mechanism to scan binary files
        leaking_addresses: Ignore input device status lines
        leaking_addresses: Use File::Temp for /tmp files
        MAINTAINERS: Update LEAKING_ADDRESSES details
        fortify: Improve buffer overflow reporting
        fortify: Add KUnit tests for runtime overflows
        ...
      216532e1
    • Linus Torvalds's avatar
      Merge tag 'execve-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · b32273ee
      Linus Torvalds authored
      Pull execve updates from Kees Cook:
      
       - Drop needless error path code in remove_arg_zero() (Li kunyu, Kees
         Cook)
      
       - binfmt_elf_efpic: Don't use missing interpreter's properties (Max
         Filippov)
      
       - Use /bin/bash for execveat selftests
      
      * tag 'execve-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        exec: Simplify remove_arg_zero() error path
        selftests/exec: Perform script checks with /bin/bash
        exec: Delete unnecessary statements in remove_arg_zero()
        fs: binfmt_elf_efpic: don't use missing interpreter's properties
      b32273ee
    • Linus Torvalds's avatar
      Merge tag 'pstore-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · 41cb8c33
      Linus Torvalds authored
      Pull pstore updates from Kees Cook:
      
       - Make PSTORE_RAM available by default on arm64 (Nícolas F R A Prado)
      
       - Allow for dynamic initialization in modular build (Guilherme G
         Piccoli)
      
       - Add missing allocation failure check (Kunwu Chan)
      
       - Avoid duplicate memory zeroing (Christophe JAILLET)
      
       - Avoid potential double-free during pstorefs umount
      
      * tag 'pstore-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        pstore/zone: Don't clear memory twice
        pstore/zone: Add a null pointer check to the psz_kmsg_read
        efi: pstore: Allow dynamic initialization based on module parameter
        arm64: defconfig: Enable PSTORE_RAM
        pstore/ram: Register to module device table
        pstore: inode: Only d_invalidate() is needed
      41cb8c33
    • Linus Torvalds's avatar
      Merge tag 'nfsd-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · a01c9fe3
      Linus Torvalds authored
      Pull nfsd updates from Chuck Lever:
       "The bulk of the patches for this release are optimizations, code
        clean-ups, and minor bug fixes.
      
        One new feature to mention is that NFSD administrators now have the
        ability to revoke NFSv4 open and lock state. NFSD's NFSv3 support has
        had this capability for some time.
      
        As always I am grateful to NFSD contributors, reviewers, and testers"
      
      * tag 'nfsd-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (75 commits)
        NFSD: Clean up nfsd4_encode_replay()
        NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
        NFSD: Document nfsd_setattr() fill-attributes behavior
        nfsd: Fix NFSv3 atomicity bugs in nfsd_setattr()
        nfsd: Fix a regression in nfsd_setattr()
        NFSD: OP_CB_RECALL_ANY should recall both read and write delegations
        NFSD: handle GETATTR conflict with write delegation
        NFSD: add support for CB_GETATTR callback
        NFSD: Document the phases of CREATE_SESSION
        NFSD: Fix the NFSv4.1 CREATE_SESSION operation
        nfsd: clean up comments over nfs4_client definition
        svcrdma: Add Write chunk WRs to the RPC's Send WR chain
        svcrdma: Post WRs for Write chunks in svc_rdma_sendto()
        svcrdma: Post the Reply chunk and Send WR together
        svcrdma: Move write_info for Reply chunks into struct svc_rdma_send_ctxt
        svcrdma: Post Send WR chain
        svcrdma: Fix retry loop in svc_rdma_send()
        svcrdma: Prevent a UAF in svc_rdma_send()
        svcrdma: Fix SQ wake-ups
        svcrdma: Increase the per-transport rw_ctx count
        ...
      a01c9fe3
    • Linus Torvalds's avatar
      Merge tag 'erofs-for-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs · f153fbe1
      Linus Torvalds authored
      Pull erofs updates from Gao Xiang:
       "In this cycle, we introduce compressed inode support over fscache
        since a lot of native EROFS images are explicitly compressed so that
        EROFS over fscache can be more widely used even without Dragonfly
        Nydus [1].
      
        Apart from that, there are some folio conversions for compressed
        inodes available as well as a lockdep false positive fix.
      
        Summary:
      
         - Some folio conversions for compressed inodes;
      
         - Add compressed inode support over fscache;
      
         - Fix lockdep false positives of erofs_pseudo_mnt"
      
      Link: https://nydus.dev [1]
      
      * tag 'erofs-for-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
        erofs: support compressed inodes over fscache
        erofs: make iov_iter describe target buffers over fscache
        erofs: fix lockdep false positives on initializing erofs_pseudo_mnt
        erofs: refine managed cache operations to folios
        erofs: convert z_erofs_submissionqueue_endio() to folios
        erofs: convert z_erofs_fill_bio_vec() to folios
        erofs: get rid of `justfound` debugging tag
        erofs: convert z_erofs_do_read_page() to folios
        erofs: convert z_erofs_onlinepage_.* to folios
      f153fbe1
    • Linus Torvalds's avatar
      Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux · d453cc5a
      Linus Torvalds authored
      Pull fsverity update from Eric Biggers:
       "Slightly improve data verification performance by eliminating an
        unnecessary lock"
      
      * tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux:
        fsverity: remove hash page spin lock
      d453cc5a
    • Linus Torvalds's avatar
      Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux · 3bf95d56
      Linus Torvalds authored
      Pull fscrypt updates from Eric Biggers:
       "Fix flakiness in a test by releasing the quota synchronously when a
        key is removed, and other minor cleanups"
      
      * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux:
        fscrypt: shrink the size of struct fscrypt_inode_info slightly
        fscrypt: write CBC-CTS instead of CTS-CBC
        fscrypt: clear keyring before calling key_put()
        fscrypt: explicitly require that inode->i_blkbits be set
      3bf95d56
    • Linus Torvalds's avatar
      Merge tag 'affs-for-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · cbcb9b5b
      Linus Torvalds authored
      Pull affs update from David Sterba:
       "One change to AFFS that removes use of SLAB_MEM_SPREAD, which is going
        to be removed from MM code"
      
      * tag 'affs-for-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        affs: remove SLAB_MEM_SPREAD flag usage
      cbcb9b5b
    • Linus Torvalds's avatar
      Merge tag 'for-6.9-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 43a7548e
      Linus Torvalds authored
      Pull btrfs updates from David Sterba:
       "Mostly stabilization, refactoring and cleanup changes. There rest are
        minor performance optimizations due to caching or lock contention
        reduction and a few notable fixes.
      
        Performance improvements:
      
         - minor speedup in logging when repeatedly allocated structure is
           preallocated only once, improves latency and decreases lock
           contention
      
         - minor throughput increase (+6%), reduced lock contention after
           clearing delayed allocation bits, applies to several common
           workload types
      
         - skip full quota rescan if a new relation is added in the same
           transaction
      
        Fixes:
      
         - zstd fix for inline compressed file in subpage mode, updated
           version from the 6.8 time
      
         - proper qgroup inheritance ioctl parameter validation
      
         - more fiemap followup fixes after reduced locking done in 6.8:
            - fix race when detecting delalloc ranges
      
        Core changes:
      
         - more debugging code:
            - added assertions for a very rare crash in raid56 calculation
            - tree-checker dumps page state to give more insights into
              possible reference counting issues
      
         - add checksum calculation offloading sysfs knob, for now enabled
           under DEBUG only to determine a good heuristic for deciding the
           offload or synchronous, depends on various factors (block group
           profile, device speed) and is not as clear as initially thought
           (checksum type)
      
         - error handling improvements, added assertions
      
         - more page to folio conversion (defrag, truncate), cached size and
           shift
      
         - preparation for more fine grained locking of sectors in subpage
           mode
      
         - cleanups and refactoring:
            - include cleanups, forward declarations
            - pointer-to-structure helpers
            - redundant argument removals
            - removed unused code
            - slab cache updates, last use of SLAB_MEM_SPREAD removed"
      
      * tag 'for-6.9-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (114 commits)
        btrfs: reuse cloned extent buffer during fiemap to avoid re-allocations
        btrfs: fix race when detecting delalloc ranges during fiemap
        btrfs: fix off-by-one chunk length calculation at contains_pending_extent()
        btrfs: qgroup: allow quick inherit if snapshot is created and added to the same parent
        btrfs: qgroup: validate btrfs_qgroup_inherit parameter
        btrfs: include device major and minor numbers in the device scan notice
        btrfs: mark btrfs_put_caching_control() static
        btrfs: remove SLAB_MEM_SPREAD flag use
        btrfs: qgroup: always free reserved space for extent records
        btrfs: tree-checker: dump the page status if hit something wrong
        btrfs: compression: remove dead comments in btrfs_compress_heuristic()
        btrfs: subpage: make writer lock utilize bitmap
        btrfs: subpage: make reader lock utilize bitmap
        btrfs: unexport btrfs_subpage_start_writer() and btrfs_subpage_end_and_test_writer()
        btrfs: pass a valid extent map cache pointer to __get_extent_map()
        btrfs: merge btrfs_del_delalloc_inode() helpers
        btrfs: pass btrfs_device to btrfs_scratch_superblocks()
        btrfs: handle transaction commit errors in flush_reservations()
        btrfs: use KMEM_CACHE() to create btrfs_free_space cache
        btrfs: use KMEM_CACHE() to create delayed ref caches
        ...
      43a7548e
    • Linus Torvalds's avatar
      Merge tag 'zonefs-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs · 35d4aeea
      Linus Torvalds authored
      Pull zonefs update from Damien Le Moal:
      
       - A single change for this cycle to convert zonefs to use the new
         mount API
      
      * tag 'zonefs-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs:
        zonefs: convert zonefs to use the new mount api
      35d4aeea
    • Linus Torvalds's avatar
      Merge tag 'asm-generic-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic · 65d287c7
      Linus Torvalds authored
      Pull asm-generic updates from Arnd Bergmann:
       "Just two small updates this time:
      
         - A series I did to unify the definition of PAGE_SIZE through
           Kconfig, intended to help with a vdso rework that needs the
           constant but cannot include the normal kernel headers when building
           the compat VDSO on arm64 and potentially others
      
         - a patch from Yan Zhao to remove the pfn_to_virt() definitions from
           a couple of architectures after finding they were both incorrect
           and entirely unused"
      
      * tag 'asm-generic-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
        arch: define CONFIG_PAGE_SIZE_*KB on all architectures
        arch: simplify architecture specific page size configuration
        arch: consolidate existing CONFIG_PAGE_SIZE_*KB definitions
        mm: Remove broken pfn_to_virt() on arch csky/hexagon/openrisc
      65d287c7