summaryrefslogtreecommitdiff
path: root/tools/testing
AgeCommit message (Collapse)Author
2026-09-03Merge tag 'net-7.3-rc2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from bluetooth. Previous releases - regressions: - page_pool: keep frag_offset aligned for odd-sized requests - sched: fix u32 duplicate handle when node ID pool is exhausted - udp: create exceptions before socket matching - igmp: convert struct ip_sf_list to RCU - ip6_gre: check tunnel info before xmit in ip6gre_tunnel_xmit - rds: acquire the fastpath locks in rds_conn_shutdown() - tipc: - protect node reset trace dump with node lock - fix NULL deref in tipc_named_node_up() on empty publication list - bluetooth: - L2CAP: fix out-of-bounds write in l2cap_ecred_connect - hci_core: fix race condition during device registration - eth: - mlx5e: prevent stale XSK buffer release on refill retries - bridge: don't truncate the port group walk on teardown Previous releases - always broken: - gro: fix nesting of TCP GSO SKBs in skb_gro_receive_list() - sched: fix skb sizing and action leak on reoffload delete - tcp: fix use-after-free in do_tcp_getsockopt() - af_packet: don't cast tpacket_hdr.tp_len to int in tpacket_parse_header() - sctp: fix soft lockup from unpadded ASCONF-ACK parameter iteration - iptunnel: fix stale transport header during tunnel decapsulation - eth: - vxlan: fix use-after-free in vxlan_mdb_remote_src_del() - bonding: fix uninitialized transport header access in alb_determine_nd()" * tag 'net-7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (83 commits) net: gro: Fix nesting of TCP GSO SKBs in skb_gro_receive_list() net: stmmac: reconfigure RX packet parser table in stmmac_hw_setup() after reset net: airoha: enable RX_DONE interrupt for RX queue 31 net/rds: don't let rds_conn_shutdown() consume a concurrent drop net/rds: acquire the fastpath locks in rds_conn_shutdown() net/rds: acquire RDS_IN_XMIT in rds_tcp_reset_callbacks() net/rds: tcp: don't force RDS_CONN_RESETTING over a concurrent shutdown net/rds: clear cp_flags bits individually in rds_conn_path_reset() net/rds: use clear_bit_unlock() in release_refill() net/rds: use wq_has_sleeper() in release_in_xmit() net: usb: qmi_wwan: add Compal EXM-G1x support net: macb: exclude software FCS from TX byte statistics net: Remove conflicting altnames for dying netns in __dev_change_net_namespace(). net: bridge: mcast: don't truncate the port group walk on teardown bonding: do not clear curr_active_slave prematurely when releasing all slaves net: qrtr: Send HELLO message on endpoint register octeontx2-af: Fix limiting SRIOV VF count logic bonding: alb: fix uninitialized transport header access in alb_determine_nd() s390/ctcm: Prevent XID null dereference net: psp: do not inherit the Rx association on clone ...
2026-09-03selftests/bpf: Check syscall helpers in timer callbacksKumar Kartikeya Dwivedi
A BPF_PROG_TYPE_SYSCALL program is sleepable, but its bpf_timer callbacks run in a non-sleepable hrtimer softirq context. Add verifier cases that call bpf_sys_bpf() and bpf_sys_close() from timer callbacks. Without the syscall helper prototype annotations these programs load, so their failure expectations expose the bug. Also add successful controls that call each helper from the syscall program main body, ensuring that the intended sleepable use remains accepted. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20260903144433.1716731-11-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-09-03selftests/bpf: Test sched_process_wait nullable argumentKumar Kartikeya Dwivedi
Add a load-time verifier test that dereferences argument 0 of the sched_process_wait tp_btf program without checking it. The test expects the nullable-pointer diagnostic, so it is accepted unexpectedly before the fix and rejected as expected after it. Add a successful control that checks the argument for NULL before the dereference. This ensures the nullable marking preserves legitimate access to the pid when the tracepoint supplies one. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20260903144433.1716731-9-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-09-03selftests/bpf: Reject resilient unlock in rbtree callbackKumar Kartikeya Dwivedi
Add a load-only verifier regression for a resilient lock operation in an rbtree comparison callback. The program holds the rbtree's regular spin lock and a separate resilient lock, then releases the resilient lock from the callback. This isolates the missing kfunc policy check without running a concurrent tree mutation. Release the resilient lock before the regular lock on the outer fall-through. The broken verifier therefore accepts the balanced program, while the fixed verifier rejects the resilient unlock specifically while verifying the callback. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20260903144433.1716731-7-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-09-03selftests/bpf: Test direct tail calls from callbacksKumar Kartikeya Dwivedi
tailcall_callback tests a tail call one static subprogram below a callback. That reaches the later stack-depth rejection, but it does not exercise the tail-call helper while the current frame is itself a callback. Add a callback that calls bpf_tail_call directly and expect the existing "cannot tail call within callback" diagnostic. On an affected kernel, the load instead reaches the "callback unexpected regs" verifier bug, so the expected message is absent and the test fails. The existing ordinary subprogram case remains a success control for legitimate tail calls. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20260903144433.1716731-5-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-09-03selftests/bpf: Cover signal tracepoint siginfo sentinelsKumar Kartikeya Dwivedi
Add load-only verifier coverage for the signal_generate and signal_deliver info arguments. The signal_generate case performs a NULL check before dereferencing info, ensuring that merely making it nullable cannot satisfy the test when the nonzero SEND_SIG_PRIV sentinel is used. Both programs load successfully without the verifier fix, contrary to their expected-failure annotations. With the fix, info is a scalar and the attempted dereferences are rejected. Also add success cases showing that plain raw tracepoint and tp_btf programs can continue to read and compare the context word as a scalar. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20260903144433.1716731-3-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-09-03selftests/bpf: Add test for showing a void BTF typeJiayuan Chen
Extend the snprintf_btf test with type_ids from the vmlinux BTF that used to NULL-deref in the BTF show path: a "const void", checked to render the "<unsupported kind:0>" placeholder, and a BTF_KIND_VAR, checked to resolve and render without error. The program renders from its own buffer and the test picks a VAR whose resolved type fits it, so the render stays in bounds. Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev> Link: https://lore.kernel.org/r/20260901104924.346187-6-jiayuan.chen@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-09-03selftests/bpf: Add test for key-less BTF hash mapJiayuan Chen
Create a hash and an rhash map with btf_key_type_id == 0 and expect bpf_map_create() to fail with -EINVAL; a positive control with a real key type confirms the rejection is about the key-less BTF and not some unrelated failure. Such a map used to be accepted and then NULL-deref in btf_type_show() when dumped through bpffs. Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev> Link: https://lore.kernel.org/r/20260901104924.346187-5-jiayuan.chen@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-09-03selftests/alsa: Fix the step check for INTEGER controlsHyeongJun An
The modulo sits inside the subtraction, so the check evaluates int_val - (min % step) rather than (int_val - min) % step. The INTEGER64 branch below it is parenthesised correctly. The written form passes only when the value equals min % step, and such a value is always on a step boundary, so it never misses a real violation. It only reports valid values as invalid. snd-aloop declares step 1 on four controls, so every non-zero value on them is reported. Before: # PCM Rate Shift 100000.0 value 100000 invalid for step 1 minimum 80000 # Totals: pass:660 fail:101 xfail:0 xpass:0 skip:296 error:0 After, same card, nothing else changed: # Totals: pass:740 fail:21 xfail:0 xpass:0 skip:296 error:0 Eighteen files under sound/ declare a non-zero step. Fixes: 5aaf9efffc57 ("kselftest: alsa: Add simplistic test for ALSA mixer controls kselftest") Signed-off-by: HyeongJun An <sammiee5311@gmail.com> Assisted-by: Claude:claude-opus-5 Link: https://patch.msgid.link/20260903123832.97377-1-sammiee5311@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-09-02selftests: drv-net: bump the timeout to 15minJakub Kicinski
The XDP test takes 9m30s on the slowest NIC with debug kernel. Let's give ourselves a 50% margin and set the timeout to 15min. Reviewed-by: Joe Damato <joe@dama.to> Reviewed-by: Nimrod Oren <noren@nvidia.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20260901200728.2063720-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02selftests: drv-net: split gro.py into one test per coalescing modeJakub Kicinski
gro.py runs its full set of cases three times over - against SW GRO, HW GRO and LRO. It's our test with the longest runtime. The 318 cases take 12m30s on mlx5 with a debug kernel. Bumping the timeout for all tests feels wrong when we can so easily split the GRO test by execution mode. Shorter runtime also helps retry just the failing portion / mode (we retry failing tests to try to detect flakes vs real failures). Move the main logic to gro_lib.py and add one program per mode - gro_sw.py, gro_hw.py and gro_lro.py, 102 cases each. Move PPPoE to a dedicated test. It has been tacked onto the tests in an ugly way, and it only runs against SW GRO anyway. Note that unfortunately this will case a rename of all test cases. The mode moves from the case name to the test name gro.py test.sw_ipv4_data_same becomes gro_sw.py test.ipv4_data_same Reviewed-by: Joe Damato <joe@dama.to> Reviewed-by: Nimrod Oren <noren@nvidia.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20260901200728.2063720-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02selftests: drv-net: hw: rename gro_hw.py to gro_stats.pyJakub Kicinski
We need to free up the gro_hw.py name for the HW-GRO half of gro.py, which we need to split by mode (sw / hw / lro). The file checks mostly qstat counters, so name it after stats. Reviewed-by: Joe Damato <joe@dama.to> Reviewed-by: Nimrod Oren <noren@nvidia.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20260901200728.2063720-2-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02selftests/bpf: BPF_PSEUDO_FUNC reference to the main programEduard Zingerman
Add a test case for a BPF_PSEUDO_FUNC load instruction that references the entry function of the program it belongs to. W/o the previous patch the verifier accepts this program thus allowing a runtime call at a bogus address. See previous patch for detailed description. Main function needs to be marked with BTF_FUNC_STATIC for the test to trigger the bug, the patch uses test_verifier harness instead of test_prog because libbpf has no way to convey this. Reported-by: Nicholas Carlini <npc@anthropic.com> Suggested-by: Nicholas Carlini <npc@anthropic.com> Signed-off-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20260902233658.1186477-2-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-09-02selftests/bpf: Check for flag presence in bpf_program__flags()Toke Høiland-Jørgensen
Add a check that the BPF_F_XDP_HAS_FRAGS and BPF_F_SLEEPABLE flags show up in bpf_program__flags() when opening a BPF program with the flag definitions in their section definitions. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20260901-libbpf-frags-flags-v3-4-4eb6f14968b0@redhat.com
2026-09-02selftests/bpf: Set BPF program flags non-destructivelyToke Høiland-Jørgensen
A couple of the BPF selftests would set the program flags without looking at the existing program flags, overriding any other flag values. To avoid issues when we change libbpf to carry section flags in prog_flags, change this to always set the flag value non-destructively by OR'ing it with the existing flags. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20260901-libbpf-frags-flags-v3-2-4eb6f14968b0@redhat.com
2026-09-02selftests/bpf: Add regression test for queue/stack map size limitYuan Chen
Verify that queue/stack maps whose element storage would overflow the u32 head/tail index multiplication are rejected at creation time, and that max_entries == U32_MAX (which would wrap the u32 capacity counter to 0) is rejected as well. Signed-off-by: Yuan Chen <chenyuan@kylinos.cn> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20260831063226.621309-3-chenyuan_fl@163.com
2026-09-02selftests/bpf: test case for unsafe pruning of bpf_loop checkpointsEduard Zingerman
The following BPF program was erroneously accepted by the verifier: static int cb(int i, __u64 *ctx) { /* unsafe on a second iteration */ small_arr[*ctx] = i; *ctx = 100500; return 0; } int main(void *ctx) { int nr_loops = 1; u64 ctx = 0; if (unlikely(bpf_get_prandom_u32() == 42)) nr_loops = 2; bpf_loop(nr_loops, cb, &ctx, 0); return 0; } The branch with nr_loops == 1 was explored first and injected a checkpoint at the entry to 'cb', such that nr_loops in the main's frame was not marked as precise. This checkpoint pruned the state with nr_loops == 2 and the program was accepted. This test case corresponds to the program above. Entry point is written in assembly to ensure branch processing order. Signed-off-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20260831-bug-015-backtrack-cb-args-precise-v1-2-68a8e2a821e0@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-09-02selftests/bpf: Precision tracking across BPF_ABS subprog exitEduard Zingerman
A test case checking that the verifier properly backtracks both fallthrough and implicit subprogram exit paths modelled for BPF_LD | BPF_ABS instruction. Without the previous patch: - the verifier did not call bt_subprog_enter() on the implicit subprogram exit path; - bpf_pseudo_call() branch in backtrack_insn() executed 'bpf_bt_set_frame_reg(bt, bt->frame - 1, i);' with bt->frame == 0; - causing a segmentation fault. Reported-by: Nicholas Carlini <npc@anthropic.com> Suggested-by: Nicholas Carlini <npc@anthropic.com> Signed-off-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20260901-bug-016-backtrack-ld-abs-v1-2-59368f1be435@gmail.com
2026-09-02selftests/fuse: add test for FUSE_HAS_SYNCFS privilege gatingJimmy Zuber
Add a selftest that talks the raw FUSE protocol over /dev/fuse (rather than via libfuse, which negotiates INIT internally) so it can both choose whether to advertise FUSE_HAS_SYNCFS and directly observe whether a FUSE_SYNCFS opcode is forwarded by the kernel. Three cases are covered: T1: host-root mount, server sets FUSE_HAS_SYNCFS -> FUSE_SYNCFS must reach the server. T2: host-root mount, server does not opt in -> FUSE_SYNCFS must not be sent (back-compat). T3: server opts in but opened /dev/fuse without CAP_SYS_ADMIN while still in the initial user namespace -> FUSE_SYNCFS must be withheld. This is the case that distinguishes gating on the server's privilege from gating on the mount's user namespace. Signed-off-by: Jimmy Zuber <jamz@amazon.com> Assisted-by: Claude:claude-opus-4-8 [Claude-Code] Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2026-09-01kselftest/riscv: Replace __ASSEMBLY__ with __ASSEMBLER__Thomas Huth
While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembly code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. This can be very confusing when switching between userspace and kernelspace coding, or when dealing with uapi headers that rather should use __ASSEMBLER__ instead. So let's standardize now on the __ASSEMBLER__ macro that is provided by the compilers. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Link: https://patch.msgid.link/20260813075304.75988-1-thuth@redhat.com Signed-off-by: Paul Walmsley <pjw@kernel.org>
2026-09-01riscv: report Zfhmin/Zvfhmin when Zfh/Zvfh are presentJinRui
The RISC-V ISA manual specifies that Zfh implies Zfhmin, a normative rule clarified in https://github.com/riscv/riscv-isa-manual/pull/3070. Zvfh likewise implies Zvfhmin, as stated by the vector extension specification. The kernel currently reports ZFH and ZFHMIN (and ZVFH and ZVFHMIN) as independent hwprobe bits derived only from what the device tree declares. Platforms that declare just "zfh" (Zfh being a superset that already contains all Zfhmin instructions) therefore report RISCV_HWPROBE_EXT_ZFHMIN=0, which breaks userspace RVA23 conformance checks (e.g. snapd installing core26 on riscv64). Use the existing superset mechanism to set the implied subset bits: - zfh implies zfhmin - zvfh implies zvfhmin Add a hwprobe selftest asserting the implication holds and update the hwprobe documentation accordingly. This is complementary to the rva23u64 base behavior discussion: the RVA23 conformance query proposed there is derived from the per-extension bits fixed here, so correct EXT_0 reporting is a prerequisite for it to work on harts whose device tree declares only "zfh". Tested on a RISC-V QEMU VM whose device tree only declares "zfh" and "zvfh": with this change both /proc/cpuinfo and the hwprobe RISCV_HWPROBE_KEY_IMA_EXT_0 bitmap report ZFHMIN and ZVFHMIN, and the hwprobe selftest (including the new implication check) passes. Link: https://lore.kernel.org/kvm-riscv/20260206002349.96740-1-andrew.jones@oss.qualcomm.com/ Signed-off-by: JinRui <jinrui@haiwei.tech> Link: https://patch.msgid.link/7190E4DB338251C3+20260811081513.2849980-1-jinrui@haiwei.tech [pjw@kernel.org: trimmed superfluous blank line in tags] Signed-off-by: Paul Walmsley <pjw@kernel.org>
2026-09-01cxl/test: Map mock device nodes to an online nodeDavidlohr Bueso
cxl_type3_mem_init() and cxl_type2_mem_init() assign alternating NUMA nodes to the mock memdevs to model multi-node topologies. On a single-node host node 1 has no pgdat, and the first node-aware allocation in an odd device's probe faults on a NULL zonelist: Oops: general protection fault, probably for non-canonical address 0xdffffc00000006e3 KASAN: probably user-memory-access in range [0x0000000000003718-0x000000000000371f] Workqueue: async async_run_entry_fn RIP: __alloc_frozen_pages_noprof+0x288 new_slab ___slab_alloc __kmalloc_node_track_caller_noprof devm_kmalloc cxl_mock_mem_probe Map the requested node to an online one, as dax_hmem already does for its target node. Fixes: cf1f6877b088 ("cxl/memdev: Add numa_node attribute") Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Tested-by: Alison Schofield <alison.schofield@intel.com> Tested-by: Shaikh Kamaluddin <shaikhkamal2012@gmail.com> Reviewed-by: Gregory Price (Meta) <gourry@gourry.net> Link: https://patch.msgid.link/20260831175119.3247915-1-dave@stgolabs.net Signed-off-by: Dave Jiang <dave.jiang@intel.com>
2026-09-01selftests/hid: prepare test_rdesc_fixup_get_data_overflow for the new verifierBenjamin Tissoires
The new verifier in the bpf-next branch is now capable of detecting the overflow that was triggered by test_rdesc_fixup_get_data_overflow. This is better in terms of UI, but now the test is failing and should be marked as expected to fail. Add a new parameter to load_programs() when we expect the test to fail, and dynamically validate the test by checkcing if it loads (it should fail to load with new verifier), but if it still loads, HID-BPF should detect the overflow itself and return an error in hid_bpf_get_data(). Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2026-09-01selftests/hid: Add a test to ensure we can write fields in hid_deviceBenjamin Tissoires
hid_device->{name,uniq,phys} are all writeable fields, we need to have tests for them in case the verifier becomes too much strict. Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2026-09-01Merge drm/drm-fixes into drm-misc-fixesMaxime Ripard
Let's start the 7.3 drm-misc-fixes cycle. Signed-off-by: Maxime Ripard <mripard@kernel.org>
2026-08-31selftests: net: Add exception cache testsIdo Schimmel
Add a test for the IPv4 and IPv6 exception caches, covering the exceptions that are created in response to ICMP errors quoting a UDP packet. The topology consists of a host (h1) that reaches a remote host (h2) via a router (r1), with a second router (r2) attached to the segment shared by h1 and r1. UDP packets are injected using a packet socket, so that an ICMP error quoting them is only matched to a socket when one was opened separately with the same source port. PMTU errors are provoked by lowering the MTU of the far end of the path and redirects by pointing r1's route towards h2 back over the segment it received the packet from. The following is tested for both address families and for both PMTU and redirect exceptions: * An error that is not matched to a socket creates an exception that carries the new MTU or gateway. * An error that is matched to a socket creates the same exception. The PMTU tests further verify that a lower PMTU replaces the one stored in the exception whereas a higher one does not, and that a socket which disabled PMTU discovery using IP{,V6}_PMTUDISC_OMIT gets the same exception as the other cases. Without "ipv4: udp: Create exceptions before socket matching" and "ipv6: udp: Create exceptions before socket matching", the tests that do not open a socket fail: # ./exception_cache.sh TEST: IPv4: PMTU: exception without a matching socket [FAIL] No socket: exception does not carry an MTU of 1400 TEST: IPv6: PMTU: exception without a matching socket [FAIL] No socket: exception does not carry an MTU of 1400 TEST: IPv4: PMTU: exception with a matching socket [ OK ] TEST: IPv6: PMTU: exception with a matching socket [ OK ] TEST: IPv4: PMTU: exception with a socket ignoring it [FAIL] PMTU discovery disabled: exception does not carry an MTU of 1400 TEST: IPv6: PMTU: exception with a socket ignoring it [FAIL] PMTU discovery disabled: exception does not carry an MTU of 1400 TEST: IPv4: Redirect: exception without a matching socket [FAIL] No socket: exception does not carry the new gateway TEST: IPv6: Redirect: exception without a matching socket [FAIL] No socket: exception does not carry the new gateway TEST: IPv4: Redirect: exception with a matching socket [ OK ] TEST: IPv6: Redirect: exception with a matching socket [ OK ] Signed-off-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20260828192344.2596928-5-idosch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-31selftests: tc-testing: add u32 node ID pool exhaustion testJamal Hadi Salim
Add a tdc test case that fills the u32 node ID space with 4095 auto-generated handles, then attempts to add a 4096th. On the fixed kernel the 4096th filter is rejected with ENOSPC (exit 2). On the unfixed kernel it silently succeeds with a duplicate handle. The setup pipes the 4095 add commands directly into `tc -b -` inside a single bash -c (matching the existing test id 1234 pattern), avoiding any temp file. Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Link: https://patch.msgid.link/20260825081052.133898-2-jhs@mojatatu.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-31Merge tag 'cgroup-for-7.3-rc1-fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup fixes from Tejun Heo: - After cgroup.kill was written to a cgroup, every child cloned into it with CLONE_INTO_CGROUP was spuriously killed because the fork path snapshotted the kill counter before resolving the target cgroup - Releasing an isolated cpuset partition dropped the isolation of CPUs isolated on the kernel command line - Selftest and documentation fixes * tag 'cgroup-for-7.3-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: selftests/cgroup: test clone3() into a previously killed cgroup cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children selftests/cgroup: Add test for preserving boot-isolated CPUs cgroup/cpuset: Preserve boot-isolated CPUs on partition release selftests/cgroup: Drop invalid boot isolation comparison docs: cgroup-v2: fix misc.events key format description selftests/cgroup: Fix cg_run_in_subcgroups ignoring arg parameter selftests/cgroup: set the test plan after the setup checks
2026-08-31tools/testing/cxl: Don't wrap cxl_core's own exported symbolsRichard Cheng
Building cxl_test with LLVM=1 (ld.lld) fails in modpost: """ cxl_core: .export_symbol section references '__wrap_...', but it does not seem to be an export symbol """ cxl_test --wraps 6 symbols that cxl_core both defines and exports. GNU ld only wraps undefined references, but ld.lld also redirects references to defined symbols, so cxl_core's own EXPORT_SYMBOL entries get rewritten to __wrap_* and modpost rejects them. cxl_core never calls these symbols, so wrap them only in the caller modules via LDFLAGS_<module>.o instead of the global ldflags-y. Signed-off-by: Richard Cheng <icheng@nvidia.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Tested-by: Shaikh Kamaluddin <shaikhkamal2012@gmail.com> Link: https://patch.msgid.link/20260721084009.38100-1-icheng@nvidia.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
2026-08-31selftests/cgroup: test clone3() into a previously killed cgroupEtienne Perot
Once cgroup.kill had been written to a cgroup, a stale kill_seq snapshot (taken in cgroup_css_set_fork() before the target cgroup was resolved) caused every child subsequently cloned into that cgroup with clone3(CLONE_INTO_CGROUP) to be SIGKILLed on the spot. Add a regression test: create a cgroup, kill it while it is empty, then clone a child into it and check that the child runs and exits cleanly. On a kernel without the fix, the test fails: not ok 4 test_cgkill_clone_into_killed The test is skipped on kernels without clone3() or without CLONE_INTO_CGROUP. Cc: Shakeel Butt <shakeel.butt@linux.dev> Assisted-by: LLM Signed-off-by: Etienne Perot <eperot@google.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2026-08-31Merge drm/drm-fixes into drm-misc-fixesThomas Zimmermann
Updating drm-misc-fixes to the state of v7.2. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
2026-08-31selftests/filesystems: Add .gitignore for fscontext_ns_testMahad Ibrahim
fscontext_ns_test is listed in TEST_GEN_PROGS and is built in the fscontext_ns directory, but the directory has no .gitignore. The binary is thus left untracked by git after being compiled. git status lists: Untracked files: (use "git add <file>..." to include in what will be committed) tools/testing/selftests/filesystems/fscontext_ns/fscontext_ns_test Every test directory must include a .gitignore which contains all the generated objects, as per the documentation and convention. Add .gitignore to ignore fscontext_ns_test. Fixes: d64ba78b749a ("selftests/filesystems: test completing a context from another user namespace") Signed-off-by: Mahad Ibrahim <mahad.ibrahim.dev@gmail.com> Link: https://patch.msgid.link/20260819161738.3517-1-mahad.ibrahim.dev@gmail.com Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31selftests/filesystems: skip listxattr kernfs test if xattrs are presentDisha Goel
kernfs_test assumes that flistxattr() on /sys/kernel/warn_count always returns an empty list. However, systems with SELinux enabled may expose security.selinux xattr via listxattr() during policy load, which makes the test fail even though kernfs is behaving correctly. Skip the xattr content check if any xattrs are present, while still verifying that flistxattr() succeeds (returns >= 0) on a kernfs file. The existing user.foo getxattr check remains unchanged. This avoids false failures on SELinux-enabled systems while preserving the original purpose of the test. Tested-by: Yeswanth Krishna <yeswanth@linux.ibm.com> Signed-off-by: Disha Goel <disgoel@linux.ibm.com> Link: https://patch.msgid.link/20260803150837.91604-1-disgoel@linux.ibm.com Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31Merge patch series "binfmt_misc: only let punctuation delimit a register string"Christian Brauner
Christian Brauner <brauner@kernel.org> says: Currently we accept arbitrary delimiters which really makes no sense and from looking around it's an unused feature. Everytime we add a flag the number of possible delimiter shrinks and it makes extensions much more hazardous than they need to be. Stop it and only accept punctional as delimiters. This extends commit 8e85d50ba111 ("binfmt_misc: reject a flag character as the field delimiter"). Letters, digits, whitespace, control characters, bytes above 0x7f and the backslash now get -EINVAL. Everything deployed uses ':' anyway. * patches from https://patch.msgid.link/20260826-work-binfmt_misc-delim-v1-0-43618adf8599@kernel.org: binfmt_misc: document the field delimiter selftests/exec: test delimiter restrictions binfmt_misc: only let punctuation delimit a register string Link: https://patch.msgid.link/20260826-work-binfmt_misc-delim-v1-0-43618adf8599@kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31selftests/exec: test delimiter restrictionsChristian Brauner
Test that the new delimiter restrictions work. Link: https://patch.msgid.link/20260826-work-binfmt_misc-delim-v1-2-43618adf8599@kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31selftests/coredump: test that TIF_NOTIFY_SIGNAL doesn't truncate a coredumpChristian Brauner
Add a test that verifies that a coredump cannot be cut short by TIF_NOTIFY_SIGNAL through io_uring running task work for uninterruptible tasks. Link: https://patch.msgid.link/20260824-work-tif_notify_signal-v2-3-6609e42b3157@kernel.org Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31selftests/filesystems: Move file_stressor to dedicated subdirectoryDisha Goel
The file_stressor test requires a 30-minute timeout (1800 seconds) due to its 15-minute runtime plus setup/teardown overhead. This is significantly longer than the default 45-second timeout used by other filesystem tests. Move file_stressor into its own subdirectory (filesystems/file_stressor/) with a dedicated settings file to isolate its timeout configuration. This prevents the long timeout from affecting other fast-running tests in the filesystems/ directory. This restructuring follows the pattern used by other selftests with special requirements and ensures proper timeout handling in CI/CD environments while maintaining the default 45-second timeout for other filesystem tests. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/all/202605192100.DvRgEGZ3-lkp@intel.com/ Signed-off-by: Disha Goel <disgoel@linux.ibm.com> Link: https://patch.msgid.link/20260521101758.14639-1-disgoel@linux.ibm.com Tested-by: Yeswanth Krishna <yeswanth@linux.ibm.com> Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31selftests/nolibc: Add basic test for sendfile()Daniel Palmer
Basic smoke test for sendfile(). Signed-off-by: Daniel Palmer <daniel@thingy.jp> Link: https://patch.msgid.link/20260828103205.384589-3-daniel@thingy.jp [Thomas: add '#include sys/syscall.h', simplify test cleanup a bit] Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
2026-08-31selftests/nolibc: switch around the skip conditions in run-tests.shThomas Weißschuh
Move the potentially long list of affected architectures to the end of the conditional to make the logic easier to understand. Suggested-by: David Laight <david.laight.linux@gmail.com> Link: https://lore.kernel.org/lkml/20260824091958.7810094f@pumpkin/ Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
2026-08-31tools/nolibc: add support for hexagonThomas Weißschuh
A mostly straightforward new architecture with a few quirks: * Only qemu-user is supported for testing. * Clang is required for compilation. * -fsanitize=undefined is broken. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu> Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com> Link: https://patch.msgid.link/20260819-nolibc-hexagon-v1-3-6bc3be591f09@weissschuh.net
2026-08-31selftests/nolibc: prepare for clang-only architecturesThomas Weißschuh
Contrary to other architectures currently supported by nolibc, hexagon can only be built with clang. Prepare run-tests.sh to allow for this. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu> Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com> Link: https://patch.msgid.link/20260819-nolibc-hexagon-v1-2-6bc3be591f09@weissschuh.net
2026-08-31selftests/nolibc: stop treating skipped tests as warningThomas Weißschuh
The nolibc testsuite will always have some tests which get skipped. Due to this the full testsuite is always marked as 'warning', even though all testcases succeeded as expected. Stop treating skipped tests as warning. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://patch.msgid.link/20260818-nolibc-test-result-warning-v1-1-d15cdda84ccd@weissschuh.net
2026-08-30vxlan: mdb: Fix use-after-free in vxlan_mdb_remote_src_del()Baul Lee
vxlan_mdb_is_valid_source(), which validates MDBE_ATTR_SOURCE and every MDBE_ATTR_SRC_LIST member, accepts the all-zeros address. A source list is only accepted on a (*, G) entry, whose source is the all-zeros address, and for each member of the list an (S, G) entry is derived from it by substituting the source. Entries are keyed by a plain memcmp() of struct vxlan_mdb_entry_key, so if MDBE_ATTR_SOURCE is present and holds the all-zeros address and the source list holds it as well, the derived (S, G) key is byte-identical to the (*, G) key and resolves to the same entry. Omitting MDBE_ATTR_SOURCE is not equivalent, as the key is then left with a zero address family. vxlan_mdb_remote_src_del() removes the forwarding entry of a source before freeing the source entry: vxlan_mdb_remote_src_fwd_del(vxlan, group, remote, &ent->addr); vxlan_mdb_remote_src_entry_del(ent); With the keys aliased, the first call deletes the remote of the entry that owns 'ent' instead of a separate (S, G) entry, and frees 'ent'. The second call then runs on the freed entry, and its hlist_del() reads ->pprev and ->next out of it and writes through them. Adding the (*, G) entry with NLM_F_REPLACE and no source list marks the all-zeros source for deletion and reaches this from the sweep at the end of vxlan_mdb_remote_srcs_replace(). BUG: KASAN: slab-use-after-free in __vxlan_mdb_add+0x1cd/0xd70 Read of size 8 at addr ffff888102852500 by task poc/84 __vxlan_mdb_add+0x1cd/0xd70 vxlan_mdb_add+0xc0/0x140 rtnl_mdb_add+0x157/0x2a0 rtnetlink_rcv_msg+0x207/0x5a0 Allocated by task 84: __kmalloc_cache_noprof+0x153/0x360 vxlan_mdb_remote_srcs_add+0x2eb/0x440 __vxlan_mdb_add+0x803/0xd70 Freed by task 84: kfree+0x14c/0x3b0 vxlan_mdb_remote_del+0x129/0x1a0 __vxlan_mdb_del+0x4f/0xe0 vxlan_mdb_remote_src_fwd_del.isra.0+0x162/0x1b0 __vxlan_mdb_add+0x1c5/0xd70 The MDB operations are netns-scoped, so an unprivileged user can perform them in a new user and network namespace. Reject the all-zeros address in vxlan_mdb_is_valid_source(), which covers both call sites. A (*, G) entry is expressed by omitting the source, so nothing legitimate is refused. Discovered by XBOW, triaged by Baul Lee <baul.lee@xbow.com> Fixes: a3a48de5eade ("vxlan: mdb: Add MDB control path support") Signed-off-by: Baul Lee <baul.lee@xbow.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Link: https://patch.msgid.link/20260826173604.90158-1-baul.lee@xbow.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-30selftests/bpf: Convert lirc_mode2 to prog_tests and extend coverageSean Young
While porting, extend coverage of the BPF_LIRC_MODE2 attach/detach/ query API: - bpf_prog_attach() with invalid flags is rejected with -EINVAL and does not attach the program - bpf_prog_query() with invalid flags is rejected with -EINVAL without disturbing existing attachments - bpf_prog_query() reports the correct program id, not just count, at each step, via bpf_prog_get_info_by_fd() - a lirc chardev can hold more than one attached program: load a second, independent instance, attach it alongside the first, confirm both are reported by bpf_prog_query(), then detach it without disturbing the first program's attachment - detaching an already-detached program consistently fails with -ENOENT, for both the first and second program Signed-off-by: Sean Young <sean@mess.org> Assisted-by: Claude:claude-sonnet-5 Link: https://lore.kernel.org/bpf/20260820214332.89030-1-sean@mess.org Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
2026-08-29bpftool: Don't drop a type in the sorted C dumpIhor Solodrai
The C dump sorts types by default, so that generated headers are diffable. The sorted dump emits one type fewer than the unsorted dump of the same BTF. dump_btf_c() starts its loop at index 1 to skip the void type at BTF type ID 0. That holds for the unsorted dump, where the array index is the type ID, but not after qsort(): position 0 is then the lowest ranked type, and btf_type_rank() ranks an anonymous enum 0 while void takes the default rank of 10. So the enum is skipped, and void is emitted instead as a no-op. Fixes: 94133cf24bb3 ("bpftool: Introduce btf c dump sorting") Acked-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev> Link: https://lore.kernel.org/r/20260828215207.3105313-7-ihor.solodrai@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-08-29selftests/bpf: Add tests for bpftool btf dump format cIhor Solodrai
"bpftool btf dump format c" generates the vmlinux.h that BPF programs are built against, and it has no test coverage at all. The only in-tree consumers are build systems. Building against the header only catches what a compiler rejects, which is insufficient. Introduce a bpftool_btf_dump selftest. Dump a small hand-built BTF and compare the output against committed expectations. The BTF is assembled with btf__add_*() rather than compiled from BPF C because the fixture needs a 4-byte "long int". That is what makes bpftool render the hole in struct holey as a pair of "long: 32;" bitfields. A BPF target is always 64-bit, so a compiled fixture could not supply it. Comparing the whole dump makes every change to a generated header show up in a patch. Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev> Link: https://lore.kernel.org/r/20260828215207.3105313-6-ihor.solodrai@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-08-29selftests/bpf: NUL-terminate bpftool command outputIhor Solodrai
run_command() writes a bpftool command's output into a caller-supplied buffer, and every caller treats that buffer as a C string. However fread() reports a byte count and doesn't terminate the string. The helper does not terminate either, so callers have to zero the buffer first. prog_tests/bpftool_metadata.c does not, for example. Read one byte less and terminate in the helper. Fixes: f21fae577446 ("selftests/bpf: Add a few helpers for bpftool testing") Acked-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev> Link: https://lore.kernel.org/r/20260828215207.3105313-5-ihor.solodrai@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-08-29selftests/bpf: Compare btf_dump expected output in-processIhor Solodrai
test_btf_dump_case() writes the dumped types to a temporary file and then runs a command against the expectation: system("awk '...' 'progs/x.c' | diff -u - '/tmp/x.output.XXXXXX'"); This creates three processes per test case: a shell, awk and diff. The awk cannot be deferred to the failure path, because its output is the expected text. In a VM with a 9p root (used on BPF CI) process creation dominates the cost. A bare fork+exec measures around 110ms, so the btf_dump test cases spend most of their runtime forking. Replace the awk pipeline with a simple marker parser. Buffer the dump in memory, and use compare_text_to_expected(), which only runs diff(1) on mismatch. Measured with "time ./test_progs -t btf_dump" in the VM: real 2.751s -> 0.702s, sys 1.901s -> 0.193s This also drops the temporary file setup. Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev> Link: https://lore.kernel.org/r/20260828215207.3105313-4-ihor.solodrai@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-08-29selftests/bpf: Modernize btf_dump test scaffoldingIhor Solodrai
Refactor test_btf_dump_case() in order to: * use newer ASSERT_* macros instead of CHECK * drop the file-scope "duration" variable CHECK required Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev> Link: https://lore.kernel.org/r/20260828215207.3105313-3-ihor.solodrai@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2026-08-29selftests/bpf: Add compare_text_to_expected() helperIhor Solodrai
Some selftests generate text (such as BTF dump) and check it against an expectation committed nearby. There is no shared way to do that. prog_tests/btf_dump.c assembles an "awk ... | diff -u" pipeline and hands it to system(). Any other test wanting the same behaviour needs to reproduce both the comparison and the reporting of a mismatch. test_progs captures per-subtest output by pointing the stdout and stderr FILE * globals at a memstream. But a child process inherits descriptors, not the globals. So the "| diff -u" goes to the console instead of the subtest log and is absent from the failure report. Add a helper that compares two strings and runs diff(1) on mismatch, properly relaying the output to stdout. Add tests for the helper. Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev> Link: https://lore.kernel.org/r/20260828215207.3105313-2-ihor.solodrai@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>