Repository navigation
bpf: using rcu_read_lock for bpf_sk_storage_map iterator - #65
Closed
kernel-patches-bot wants to merge 2 commits into
Closed
kernel-patches-bot wants to merge 2 commits into
kernel-patches-bot wants to merge 2 commits into
Conversation
Author
a bucket, concurrent userspace bpf_map_update_elem() and
bpf program bpf_sk_storage_{get,delete}() may experience
some undesirable delays as they will compete with bpf_iter
for bucket lock.
Note that the number of buckets for bpf_sk_storage_map
is roughly the same as the number of cpus. So if there
are lots of sockets in the system, each bucket could
contain lots of sockets.
Different actual use cases may experience different delays.
Here, using selftest bpf_iter subtest bpf_sk_storage_map,
I hacked the kernel with ktime_get_mono_fast_ns()
to collect the time when a bucket was locked
during bpf_iter prog traversing that bucket. This way,
the maximum incurred delay was measured w.r.t. the
number of elements in a bucket.
# elems in each bucket delay(ns)
64 17000
256 72512
2048 875246
The potential delays will be further increased if
we have even more elemnts in a bucket. Using rcu_read_lock()
is a reasonable compromise here. It may lose some precision, e.g.,
access stale sockets, but it will not hurt performance of
bpf program or user space application which also tries
to get/delete or update map elements.
Cc: Martin KaFai Lau <[email protected]>
Acked-by: Song Liu <[email protected]>
Signed-off-by: Yonghong Song <[email protected]>
---
net/core/bpf_sk_storage.c | 29 ++++++++++++-----------------
1 file changed, 12 insertions(+), 17 deletions(-)
Changelog:
v2 -> v3:
- fix a bug hlist_for_each_entry() => hlist_for_each_entry_rcu(). (Martin)
- use rcu_dereference() instead of rcu_dereference_raw() for lockdep checking. (Martin)
v1 -> v2:
- added some performance number. (Song)
- tried to silence some sparse complains. but still has some left like
context imbalance in "..." - different lock contexts for basic block
which the code is too hard for sparse to analyze. (Jakub)
Author
kernel-patches-bot
force-pushed
the
series/201648=>bpf-next
branch
from
September 16, 2020 16:35
0ec13f6 to
e653a9a
Compare
Author
|
At least one diff in series https://patchwork.ozlabs.org/project/netdev/list/?series=201997 expired. Closing PR. |
kernel-patches-bot
pushed a commit
that referenced
this pull request
Oct 24, 2022
When a console stack dump is initiated with CONFIG_GCOV_PROFILE_ALL enabled, show_trace_log_lvl() gets out of sync with the ORC unwinder, causing the stack trace to show all text addresses as unreliable: # echo l > /proc/sysrq-trigger [ 477.521031] sysrq: Show backtrace of all active CPUs [ 477.523813] NMI backtrace for cpu 0 [ 477.524492] CPU: 0 PID: 1021 Comm: bash Not tainted 6.0.0 #65 [ 477.525295] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.0-1.fc36 04/01/2014 [ 477.526439] Call Trace: [ 477.526854] <TASK> [ 477.527216] ? dump_stack_lvl+0xc7/0x114 [ 477.527801] ? dump_stack+0x13/0x1f [ 477.528331] ? nmi_cpu_backtrace.cold+0xb5/0x10d [ 477.528998] ? lapic_can_unplug_cpu+0xa0/0xa0 [ 477.529641] ? nmi_trigger_cpumask_backtrace+0x16a/0x1f0 [ 477.530393] ? arch_trigger_cpumask_backtrace+0x1d/0x30 [ 477.531136] ? sysrq_handle_showallcpus+0x1b/0x30 [ 477.531818] ? __handle_sysrq.cold+0x4e/0x1ae [ 477.532451] ? write_sysrq_trigger+0x63/0x80 [ 477.533080] ? proc_reg_write+0x92/0x110 [ 477.533663] ? vfs_write+0x174/0x530 [ 477.534265] ? handle_mm_fault+0x16f/0x500 [ 477.534940] ? ksys_write+0x7b/0x170 [ 477.535543] ? __x64_sys_write+0x1d/0x30 [ 477.536191] ? do_syscall_64+0x6b/0x100 [ 477.536809] ? entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 477.537609] </TASK> This happens when the compiled code for show_stack() has a single word on the stack, and doesn't use a tail call to show_stack_log_lvl(). (CONFIG_GCOV_PROFILE_ALL=y is the only known case of this.) Then the __unwind_start() skip logic hits an off-by-one bug and fails to unwind all the way to the intended starting frame. Fix it by reverting the following commit: f1d9a2a ("x86/unwind/orc: Don't skip the first frame for inactive tasks") The original justification for that commit no longer exists. That original issue was later fixed in a different way, with the following commit: f2ac57a ("x86/unwind/orc: Fix inactive tasks with stack pointer in %sp on GCC 10 compiled kernels") Fixes: f1d9a2a ("x86/unwind/orc: Don't skip the first frame for inactive tasks") Signed-off-by: Chen Zhongjin <[email protected]> [jpoimboe: rewrite commit log] Signed-off-by: Josh Poimboeuf <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
May 17, 2023
With latest llvm17, dynptr/test_dynptr_is_null subtest failed in my testing VM. The failure log looks like below: All error logs: tester_init:PASS:tester_log_buf 0 nsec process_subtest:PASS:obj_open_mem 0 nsec process_subtest:PASS:Can't alloc specs array 0 nsec verify_success:PASS:dynptr_success__open 0 nsec verify_success:PASS:bpf_object__find_program_by_name 0 nsec verify_success:PASS:dynptr_success__load 0 nsec verify_success:PASS:bpf_program__attach 0 nsec verify_success:FAIL:err unexpected err: actual 4 != expected 0 #65/9 dynptr/test_dynptr_is_null:FAIL The error happens for bpf prog test_dynptr_is_null in dynptr_success.c. if (bpf_dynptr_is_null(&ptr2)) { err = 4; goto exit; } The bpf_dynptr_is_null(&ptr) unexpectedly returned a non-zero value and the control went to the error path. Digging further, I found the root cause is due to function signature difference between kernel and user space. In kernel, we have __bpf_kfunc bool bpf_dynptr_is_null(struct bpf_dynptr_kern *ptr) while in bpf_kfuncs.h we have extern int bpf_dynptr_is_null(const struct bpf_dynptr *ptr) __ksym; The kernel bpf_dynptr_is_null disasm code: ffffffff812f1a90 <bpf_dynptr_is_null>: ffffffff812f1a90: f3 0f 1e fa endbr64 ffffffff812f1a94: 0f 1f 44 00 00 nopl (%rax,%rax) ffffffff812f1a99: 53 pushq %rbx ffffffff812f1a9a: 48 89 fb movq %rdi, %rbx ffffffff812f1a9d: e8 ae 29 17 00 callq 0xffffffff81464450 <__asan_load8_noabort> ffffffff812f1aa2: 48 83 3b 00 cmpq $0x0, (%rbx) ffffffff812f1aa6: 0f 94 c0 sete %al ffffffff812f1aa9: 5b popq %rbx ffffffff812f1aaa: c3 retq Note that only 1-byte register %al is set and the other 7-bytes are not touched. In bpf program, the asm code for the above bpf_dynptr_is_null(&ptr2): 266: 85 10 00 00 ff ff ff ff call -0x1 267: b4 01 00 00 04 00 00 00 w1 = 0x4 268: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Basically, 4-byte subregister is tested. This might cause error as the value other than the lowest byte might not be 0. This patch fixed the issue by using the identical func prototype across kernel and selftest user space. The fixed bpf asm code: 267: 85 10 00 00 ff ff ff ff call -0x1 268: 54 00 00 00 01 00 00 00 w0 &= 0x1 269: b4 01 00 00 04 00 00 00 w1 = 0x4 270: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Signed-off-by: Yonghong Song <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
May 17, 2023
With latest llvm17, dynptr/test_dynptr_is_null subtest failed in my testing VM. The failure log looks like below: All error logs: tester_init:PASS:tester_log_buf 0 nsec process_subtest:PASS:obj_open_mem 0 nsec process_subtest:PASS:Can't alloc specs array 0 nsec verify_success:PASS:dynptr_success__open 0 nsec verify_success:PASS:bpf_object__find_program_by_name 0 nsec verify_success:PASS:dynptr_success__load 0 nsec verify_success:PASS:bpf_program__attach 0 nsec verify_success:FAIL:err unexpected err: actual 4 != expected 0 #65/9 dynptr/test_dynptr_is_null:FAIL The error happens for bpf prog test_dynptr_is_null in dynptr_success.c. if (bpf_dynptr_is_null(&ptr2)) { err = 4; goto exit; } The bpf_dynptr_is_null(&ptr) unexpectedly returned a non-zero value and the control went to the error path. Digging further, I found the root cause is due to function signature difference between kernel and user space. In kernel, we have __bpf_kfunc bool bpf_dynptr_is_null(struct bpf_dynptr_kern *ptr) while in bpf_kfuncs.h we have extern int bpf_dynptr_is_null(const struct bpf_dynptr *ptr) __ksym; The kernel bpf_dynptr_is_null disasm code: ffffffff812f1a90 <bpf_dynptr_is_null>: ffffffff812f1a90: f3 0f 1e fa endbr64 ffffffff812f1a94: 0f 1f 44 00 00 nopl (%rax,%rax) ffffffff812f1a99: 53 pushq %rbx ffffffff812f1a9a: 48 89 fb movq %rdi, %rbx ffffffff812f1a9d: e8 ae 29 17 00 callq 0xffffffff81464450 <__asan_load8_noabort> ffffffff812f1aa2: 48 83 3b 00 cmpq $0x0, (%rbx) ffffffff812f1aa6: 0f 94 c0 sete %al ffffffff812f1aa9: 5b popq %rbx ffffffff812f1aaa: c3 retq Note that only 1-byte register %al is set and the other 7-bytes are not touched. In bpf program, the asm code for the above bpf_dynptr_is_null(&ptr2): 266: 85 10 00 00 ff ff ff ff call -0x1 267: b4 01 00 00 04 00 00 00 w1 = 0x4 268: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Basically, 4-byte subregister is tested. This might cause error as the value other than the lowest byte might not be 0. This patch fixed the issue by using the identical func prototype across kernel and selftest user space. The fixed bpf asm code: 267: 85 10 00 00 ff ff ff ff call -0x1 268: 54 00 00 00 01 00 00 00 w0 &= 0x1 269: b4 01 00 00 04 00 00 00 w1 = 0x4 270: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Signed-off-by: Yonghong Song <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
May 17, 2023
With latest llvm17, dynptr/test_dynptr_is_null subtest failed in my testing VM. The failure log looks like below: All error logs: tester_init:PASS:tester_log_buf 0 nsec process_subtest:PASS:obj_open_mem 0 nsec process_subtest:PASS:Can't alloc specs array 0 nsec verify_success:PASS:dynptr_success__open 0 nsec verify_success:PASS:bpf_object__find_program_by_name 0 nsec verify_success:PASS:dynptr_success__load 0 nsec verify_success:PASS:bpf_program__attach 0 nsec verify_success:FAIL:err unexpected err: actual 4 != expected 0 #65/9 dynptr/test_dynptr_is_null:FAIL The error happens for bpf prog test_dynptr_is_null in dynptr_success.c. if (bpf_dynptr_is_null(&ptr2)) { err = 4; goto exit; } The bpf_dynptr_is_null(&ptr) unexpectedly returned a non-zero value and the control went to the error path. Digging further, I found the root cause is due to function signature difference between kernel and user space. In kernel, we have __bpf_kfunc bool bpf_dynptr_is_null(struct bpf_dynptr_kern *ptr) while in bpf_kfuncs.h we have extern int bpf_dynptr_is_null(const struct bpf_dynptr *ptr) __ksym; The kernel bpf_dynptr_is_null disasm code: ffffffff812f1a90 <bpf_dynptr_is_null>: ffffffff812f1a90: f3 0f 1e fa endbr64 ffffffff812f1a94: 0f 1f 44 00 00 nopl (%rax,%rax) ffffffff812f1a99: 53 pushq %rbx ffffffff812f1a9a: 48 89 fb movq %rdi, %rbx ffffffff812f1a9d: e8 ae 29 17 00 callq 0xffffffff81464450 <__asan_load8_noabort> ffffffff812f1aa2: 48 83 3b 00 cmpq $0x0, (%rbx) ffffffff812f1aa6: 0f 94 c0 sete %al ffffffff812f1aa9: 5b popq %rbx ffffffff812f1aaa: c3 retq Note that only 1-byte register %al is set and the other 7-bytes are not touched. In bpf program, the asm code for the above bpf_dynptr_is_null(&ptr2): 266: 85 10 00 00 ff ff ff ff call -0x1 267: b4 01 00 00 04 00 00 00 w1 = 0x4 268: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Basically, 4-byte subregister is tested. This might cause error as the value other than the lowest byte might not be 0. This patch fixed the issue by using the identical func prototype across kernel and selftest user space. The fixed bpf asm code: 267: 85 10 00 00 ff ff ff ff call -0x1 268: 54 00 00 00 01 00 00 00 w0 &= 0x1 269: b4 01 00 00 04 00 00 00 w1 = 0x4 270: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Signed-off-by: Yonghong Song <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
May 17, 2023
With latest llvm17, dynptr/test_dynptr_is_null subtest failed in my testing VM. The failure log looks like below: All error logs: tester_init:PASS:tester_log_buf 0 nsec process_subtest:PASS:obj_open_mem 0 nsec process_subtest:PASS:Can't alloc specs array 0 nsec verify_success:PASS:dynptr_success__open 0 nsec verify_success:PASS:bpf_object__find_program_by_name 0 nsec verify_success:PASS:dynptr_success__load 0 nsec verify_success:PASS:bpf_program__attach 0 nsec verify_success:FAIL:err unexpected err: actual 4 != expected 0 #65/9 dynptr/test_dynptr_is_null:FAIL The error happens for bpf prog test_dynptr_is_null in dynptr_success.c. if (bpf_dynptr_is_null(&ptr2)) { err = 4; goto exit; } The bpf_dynptr_is_null(&ptr) unexpectedly returned a non-zero value and the control went to the error path. Digging further, I found the root cause is due to function signature difference between kernel and user space. In kernel, we have __bpf_kfunc bool bpf_dynptr_is_null(struct bpf_dynptr_kern *ptr) while in bpf_kfuncs.h we have extern int bpf_dynptr_is_null(const struct bpf_dynptr *ptr) __ksym; The kernel bpf_dynptr_is_null disasm code: ffffffff812f1a90 <bpf_dynptr_is_null>: ffffffff812f1a90: f3 0f 1e fa endbr64 ffffffff812f1a94: 0f 1f 44 00 00 nopl (%rax,%rax) ffffffff812f1a99: 53 pushq %rbx ffffffff812f1a9a: 48 89 fb movq %rdi, %rbx ffffffff812f1a9d: e8 ae 29 17 00 callq 0xffffffff81464450 <__asan_load8_noabort> ffffffff812f1aa2: 48 83 3b 00 cmpq $0x0, (%rbx) ffffffff812f1aa6: 0f 94 c0 sete %al ffffffff812f1aa9: 5b popq %rbx ffffffff812f1aaa: c3 retq Note that only 1-byte register %al is set and the other 7-bytes are not touched. In bpf program, the asm code for the above bpf_dynptr_is_null(&ptr2): 266: 85 10 00 00 ff ff ff ff call -0x1 267: b4 01 00 00 04 00 00 00 w1 = 0x4 268: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Basically, 4-byte subregister is tested. This might cause error as the value other than the lowest byte might not be 0. This patch fixed the issue by using the identical func prototype across kernel and selftest user space. The fixed bpf asm code: 267: 85 10 00 00 ff ff ff ff call -0x1 268: 54 00 00 00 01 00 00 00 w0 &= 0x1 269: b4 01 00 00 04 00 00 00 w1 = 0x4 270: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Signed-off-by: Yonghong Song <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
May 17, 2023
With latest llvm17, dynptr/test_dynptr_is_null subtest failed in my testing VM. The failure log looks like below: All error logs: tester_init:PASS:tester_log_buf 0 nsec process_subtest:PASS:obj_open_mem 0 nsec process_subtest:PASS:Can't alloc specs array 0 nsec verify_success:PASS:dynptr_success__open 0 nsec verify_success:PASS:bpf_object__find_program_by_name 0 nsec verify_success:PASS:dynptr_success__load 0 nsec verify_success:PASS:bpf_program__attach 0 nsec verify_success:FAIL:err unexpected err: actual 4 != expected 0 #65/9 dynptr/test_dynptr_is_null:FAIL The error happens for bpf prog test_dynptr_is_null in dynptr_success.c. if (bpf_dynptr_is_null(&ptr2)) { err = 4; goto exit; } The bpf_dynptr_is_null(&ptr) unexpectedly returned a non-zero value and the control went to the error path. Digging further, I found the root cause is due to function signature difference between kernel and user space. In kernel, we have __bpf_kfunc bool bpf_dynptr_is_null(struct bpf_dynptr_kern *ptr) while in bpf_kfuncs.h we have extern int bpf_dynptr_is_null(const struct bpf_dynptr *ptr) __ksym; The kernel bpf_dynptr_is_null disasm code: ffffffff812f1a90 <bpf_dynptr_is_null>: ffffffff812f1a90: f3 0f 1e fa endbr64 ffffffff812f1a94: 0f 1f 44 00 00 nopl (%rax,%rax) ffffffff812f1a99: 53 pushq %rbx ffffffff812f1a9a: 48 89 fb movq %rdi, %rbx ffffffff812f1a9d: e8 ae 29 17 00 callq 0xffffffff81464450 <__asan_load8_noabort> ffffffff812f1aa2: 48 83 3b 00 cmpq $0x0, (%rbx) ffffffff812f1aa6: 0f 94 c0 sete %al ffffffff812f1aa9: 5b popq %rbx ffffffff812f1aaa: c3 retq Note that only 1-byte register %al is set and the other 7-bytes are not touched. In bpf program, the asm code for the above bpf_dynptr_is_null(&ptr2): 266: 85 10 00 00 ff ff ff ff call -0x1 267: b4 01 00 00 04 00 00 00 w1 = 0x4 268: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Basically, 4-byte subregister is tested. This might cause error as the value other than the lowest byte might not be 0. This patch fixed the issue by using the identical func prototype across kernel and selftest user space. The fixed bpf asm code: 267: 85 10 00 00 ff ff ff ff call -0x1 268: 54 00 00 00 01 00 00 00 w0 &= 0x1 269: b4 01 00 00 04 00 00 00 w1 = 0x4 270: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Signed-off-by: Yonghong Song <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
May 17, 2023
With latest llvm17, dynptr/test_dynptr_is_null subtest failed in my testing VM. The failure log looks like below: All error logs: tester_init:PASS:tester_log_buf 0 nsec process_subtest:PASS:obj_open_mem 0 nsec process_subtest:PASS:Can't alloc specs array 0 nsec verify_success:PASS:dynptr_success__open 0 nsec verify_success:PASS:bpf_object__find_program_by_name 0 nsec verify_success:PASS:dynptr_success__load 0 nsec verify_success:PASS:bpf_program__attach 0 nsec verify_success:FAIL:err unexpected err: actual 4 != expected 0 #65/9 dynptr/test_dynptr_is_null:FAIL The error happens for bpf prog test_dynptr_is_null in dynptr_success.c: if (bpf_dynptr_is_null(&ptr2)) { err = 4; goto exit; } The bpf_dynptr_is_null(&ptr) unexpectedly returned a non-zero value and the control went to the error path. Digging further, I found the root cause is due to function signature difference between kernel and user space. In kernel, we have ... __bpf_kfunc bool bpf_dynptr_is_null(struct bpf_dynptr_kern *ptr) ... while in bpf_kfuncs.h we have: extern int bpf_dynptr_is_null(const struct bpf_dynptr *ptr) __ksym; The kernel bpf_dynptr_is_null disasm code: ffffffff812f1a90 <bpf_dynptr_is_null>: ffffffff812f1a90: f3 0f 1e fa endbr64 ffffffff812f1a94: 0f 1f 44 00 00 nopl (%rax,%rax) ffffffff812f1a99: 53 pushq %rbx ffffffff812f1a9a: 48 89 fb movq %rdi, %rbx ffffffff812f1a9d: e8 ae 29 17 00 callq 0xffffffff81464450 <__asan_load8_noabort> ffffffff812f1aa2: 48 83 3b 00 cmpq $0x0, (%rbx) ffffffff812f1aa6: 0f 94 c0 sete %al ffffffff812f1aa9: 5b popq %rbx ffffffff812f1aaa: c3 retq Note that only 1-byte register %al is set and the other 7-bytes are not touched. In bpf program, the asm code for the above bpf_dynptr_is_null(&ptr2): 266: 85 10 00 00 ff ff ff ff call -0x1 267: b4 01 00 00 04 00 00 00 w1 = 0x4 268: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Basically, 4-byte subregister is tested. This might cause error as the value other than the lowest byte might not be 0. This patch fixed the issue by using the identical func prototype across kernel and selftest user space. The fixed bpf asm code: 267: 85 10 00 00 ff ff ff ff call -0x1 268: 54 00 00 00 01 00 00 00 w0 &= 0x1 269: b4 01 00 00 04 00 00 00 w1 = 0x4 270: 16 00 03 00 00 00 00 00 if w0 == 0x0 goto +0x3 <LBB9_8> Signed-off-by: Yonghong Song <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
Jan 17, 2024
Within the BPF program, we leverage the cgroup iterator to iterate through percpu runqueue data, specifically the 'nr_running' metric. Subsequently we expose this data to userspace by means of a sequence file. The CPU affinity for the cpumask is determined by the PID of a task: - PID of the init task (PID 1) We typically don't set CPU affinity for init task and thus we can iterate across all possible CPUs. However, in scenarios where you've set CPU affinity for the init task, you should set the cpumask of your current task to full-F. Then proceed to iterate through all possible CPUs using the current task. - PID of a task with defined CPU affinity The aim here is to iterate through a specific cpumask. This scenario aligns with tasks residing within a cpuset cgroup. - Invalid PID (e.g., PID -1) No cpumask is available in this case. The result as follows, #65/1 cpumask_iter/init_pid:OK #65/2 cpumask_iter/invalid_pid:OK #65/3 cpumask_iter/self_pid_one_cpu:OK #65/4 cpumask_iter/self_pid_multi_cpus:OK #65 cpumask_iter:OK Summary: 1/4 PASSED, 0 SKIPPED, 0 FAILED CONFIG_PSI=y is required for this testcase. Signed-off-by: Yafang Shao <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
Jan 17, 2024
Within the BPF program, we leverage the cgroup iterator to iterate through percpu runqueue data, specifically the 'nr_running' metric. Subsequently we expose this data to userspace by means of a sequence file. The CPU affinity for the cpumask is determined by the PID of a task: - PID of the init task (PID 1) We typically don't set CPU affinity for init task and thus we can iterate across all possible CPUs. However, in scenarios where you've set CPU affinity for the init task, you should set the cpumask of your current task to full-F. Then proceed to iterate through all possible CPUs using the current task. - PID of a task with defined CPU affinity The aim here is to iterate through a specific cpumask. This scenario aligns with tasks residing within a cpuset cgroup. - Invalid PID (e.g., PID -1) No cpumask is available in this case. The result as follows, #65/1 cpumask_iter/init_pid:OK #65/2 cpumask_iter/invalid_pid:OK #65/3 cpumask_iter/self_pid_one_cpu:OK #65/4 cpumask_iter/self_pid_multi_cpus:OK #65 cpumask_iter:OK Summary: 1/4 PASSED, 0 SKIPPED, 0 FAILED CONFIG_PSI=y is required for this testcase. Signed-off-by: Yafang Shao <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
Jan 23, 2024
Within the BPF program, we leverage the cgroup iterator to iterate through percpu runqueue data, specifically the 'nr_running' metric. Subsequently we expose this data to userspace by means of a sequence file. The CPU affinity for the cpumask is determined by the PID of a task: - PID of the init task (PID 1) We typically don't set CPU affinity for init task and thus we can iterate across all possible CPUs using the init task. However, in scenarios where you've set CPU affinity for the init task, you should set your current-task's cpu affinity to all possible CPUs and then proceed to iterate through all possible CPUs using the current task. - PID of a task with defined CPU affinity The aim here is to iterate through a specific cpumask. This scenario aligns with tasks residing within a cpuset cgroup. - Invalid PID (e.g., PID -1) No cpumask is available in this case. The result as follows, #65/1 cpumask_iter/init_pid:OK #65/2 cpumask_iter/invalid_pid:OK #65/3 cpumask_iter/self_pid_one_cpu:OK #65/4 cpumask_iter/self_pid_multi_cpus:OK #65 cpumask_iter:OK Summary: 1/4 PASSED, 0 SKIPPED, 0 FAILED CONFIG_PSI=y is required for this testcase. Signed-off-by: Yafang Shao <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
Nov 25, 2024
When the qp is in error state, the status of WQEs in the queue should be set to error. Or else the following will appear. [ 920.617269] WARNING: CPU: 1 PID: 21 at drivers/infiniband/sw/rxe/rxe_comp.c:756 rxe_completer+0x989/0xcc0 [rdma_rxe] [ 920.617744] Modules linked in: rnbd_client(O) rtrs_client(O) rtrs_core(O) rdma_ucm rdma_cm iw_cm ib_cm crc32_generic rdma_rxe ip6_udp_tunnel udp_tunnel ib_uverbs ib_core loop brd null_blk ipv6 [ 920.618516] CPU: 1 PID: 21 Comm: ksoftirqd/1 Tainted: G O 6.1.113-storage+ #65 [ 920.618986] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 [ 920.619396] RIP: 0010:rxe_completer+0x989/0xcc0 [rdma_rxe] [ 920.619658] Code: 0f b6 84 24 3a 02 00 00 41 89 84 24 44 04 00 00 e9 2a f7 ff ff 39 ca bb 03 00 00 00 b8 0e 00 00 00 48 0f 45 d8 e9 15 f7 ff ff <0f> 0b e9 cb f8 ff ff 41 bf f5 ff ff ff e9 08 f8 ff ff 49 8d bc 24 [ 920.620482] RSP: 0018:ffff97b7c00bbc38 EFLAGS: 00010246 [ 920.620817] RAX: 0000000000000000 RBX: 000000000000000c RCX: 0000000000000008 [ 920.621183] RDX: ffff960dc396ebc0 RSI: 0000000000005400 RDI: ffff960dc4e2fbac [ 920.621548] RBP: 0000000000000000 R08: 0000000000000001 R09: ffffffffac406450 [ 920.621884] R10: ffffffffac4060c0 R11: 0000000000000001 R12: ffff960dc4e2f800 [ 920.622254] R13: ffff960dc4e2f928 R14: ffff97b7c029c580 R15: 0000000000000000 [ 920.622609] FS: 0000000000000000(0000) GS:ffff960ef7d00000(0000) knlGS:0000000000000000 [ 920.622979] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 920.623245] CR2: 00007fa056965e90 CR3: 00000001107f1000 CR4: 00000000000006e0 [ 920.623680] Call Trace: [ 920.623815] <TASK> [ 920.623933] ? __warn+0x79/0xc0 [ 920.624116] ? rxe_completer+0x989/0xcc0 [rdma_rxe] [ 920.624356] ? report_bug+0xfb/0x150 [ 920.624594] ? handle_bug+0x3c/0x60 [ 920.624796] ? exc_invalid_op+0x14/0x70 [ 920.624976] ? asm_exc_invalid_op+0x16/0x20 [ 920.625203] ? rxe_completer+0x989/0xcc0 [rdma_rxe] [ 920.625474] ? rxe_completer+0x329/0xcc0 [rdma_rxe] [ 920.625749] rxe_do_task+0x80/0x110 [rdma_rxe] [ 920.626037] rxe_requester+0x625/0xde0 [rdma_rxe] [ 920.626310] ? rxe_cq_post+0xe2/0x180 [rdma_rxe] [ 920.626583] ? do_complete+0x18d/0x220 [rdma_rxe] [ 920.626812] ? rxe_completer+0x1a3/0xcc0 [rdma_rxe] [ 920.627050] rxe_do_task+0x80/0x110 [rdma_rxe] [ 920.627285] tasklet_action_common.constprop.0+0xa4/0x120 [ 920.627522] handle_softirqs+0xc2/0x250 [ 920.627728] ? sort_range+0x20/0x20 [ 920.627942] run_ksoftirqd+0x1f/0x30 [ 920.628158] smpboot_thread_fn+0xc7/0x1b0 [ 920.628334] kthread+0xd6/0x100 [ 920.628504] ? kthread_complete_and_exit+0x20/0x20 [ 920.628709] ret_from_fork+0x1f/0x30 [ 920.628892] </TASK> Fixes: ae720bd ("RDMA/rxe: Generate error completion for error requester QP state") Signed-off-by: Zhu Yanjun <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
shunghsiyu
pushed a commit
to shunghsiyu/bpf
that referenced
this pull request
Dec 18, 2024
[ Upstream commit ea4c990 ] When the qp is in error state, the status of WQEs in the queue should be set to error. Or else the following will appear. [ 920.617269] WARNING: CPU: 1 PID: 21 at drivers/infiniband/sw/rxe/rxe_comp.c:756 rxe_completer+0x989/0xcc0 [rdma_rxe] [ 920.617744] Modules linked in: rnbd_client(O) rtrs_client(O) rtrs_core(O) rdma_ucm rdma_cm iw_cm ib_cm crc32_generic rdma_rxe ip6_udp_tunnel udp_tunnel ib_uverbs ib_core loop brd null_blk ipv6 [ 920.618516] CPU: 1 PID: 21 Comm: ksoftirqd/1 Tainted: G O 6.1.113-storage+ kernel-patches#65 [ 920.618986] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 [ 920.619396] RIP: 0010:rxe_completer+0x989/0xcc0 [rdma_rxe] [ 920.619658] Code: 0f b6 84 24 3a 02 00 00 41 89 84 24 44 04 00 00 e9 2a f7 ff ff 39 ca bb 03 00 00 00 b8 0e 00 00 00 48 0f 45 d8 e9 15 f7 ff ff <0f> 0b e9 cb f8 ff ff 41 bf f5 ff ff ff e9 08 f8 ff ff 49 8d bc 24 [ 920.620482] RSP: 0018:ffff97b7c00bbc38 EFLAGS: 00010246 [ 920.620817] RAX: 0000000000000000 RBX: 000000000000000c RCX: 0000000000000008 [ 920.621183] RDX: ffff960dc396ebc0 RSI: 0000000000005400 RDI: ffff960dc4e2fbac [ 920.621548] RBP: 0000000000000000 R08: 0000000000000001 R09: ffffffffac406450 [ 920.621884] R10: ffffffffac4060c0 R11: 0000000000000001 R12: ffff960dc4e2f800 [ 920.622254] R13: ffff960dc4e2f928 R14: ffff97b7c029c580 R15: 0000000000000000 [ 920.622609] FS: 0000000000000000(0000) GS:ffff960ef7d00000(0000) knlGS:0000000000000000 [ 920.622979] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 920.623245] CR2: 00007fa056965e90 CR3: 00000001107f1000 CR4: 00000000000006e0 [ 920.623680] Call Trace: [ 920.623815] <TASK> [ 920.623933] ? __warn+0x79/0xc0 [ 920.624116] ? rxe_completer+0x989/0xcc0 [rdma_rxe] [ 920.624356] ? report_bug+0xfb/0x150 [ 920.624594] ? handle_bug+0x3c/0x60 [ 920.624796] ? exc_invalid_op+0x14/0x70 [ 920.624976] ? asm_exc_invalid_op+0x16/0x20 [ 920.625203] ? rxe_completer+0x989/0xcc0 [rdma_rxe] [ 920.625474] ? rxe_completer+0x329/0xcc0 [rdma_rxe] [ 920.625749] rxe_do_task+0x80/0x110 [rdma_rxe] [ 920.626037] rxe_requester+0x625/0xde0 [rdma_rxe] [ 920.626310] ? rxe_cq_post+0xe2/0x180 [rdma_rxe] [ 920.626583] ? do_complete+0x18d/0x220 [rdma_rxe] [ 920.626812] ? rxe_completer+0x1a3/0xcc0 [rdma_rxe] [ 920.627050] rxe_do_task+0x80/0x110 [rdma_rxe] [ 920.627285] tasklet_action_common.constprop.0+0xa4/0x120 [ 920.627522] handle_softirqs+0xc2/0x250 [ 920.627728] ? sort_range+0x20/0x20 [ 920.627942] run_ksoftirqd+0x1f/0x30 [ 920.628158] smpboot_thread_fn+0xc7/0x1b0 [ 920.628334] kthread+0xd6/0x100 [ 920.628504] ? kthread_complete_and_exit+0x20/0x20 [ 920.628709] ret_from_fork+0x1f/0x30 [ 920.628892] </TASK> Fixes: ae720bd ("RDMA/rxe: Generate error completion for error requester QP state") Signed-off-by: Zhu Yanjun <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
Dec 21, 2024
…uctions Add the following ./test_progs tests: * atomics/load_acquire * atomics/store_release * arena_atomics/load_acquire * arena_atomics/store_release They depend on the pre-defined __BPF_FEATURE_LOAD_ACQ_STORE_REL feature macro, which implies -mcpu>=v4. $ ALLOWLIST=atomics/load_acquire,atomics/store_release, $ ALLOWLIST+=arena_atomics/load_acquire,arena_atomics/store_release $ ./test_progs-cpuv4 -a $ALLOWLIST #3/9 arena_atomics/load_acquire:OK #3/10 arena_atomics/store_release:OK ... #10/8 atomics/load_acquire:OK #10/9 atomics/store_release:OK $ ./test_progs -v -a $ALLOWLIST test_load_acquire:SKIP:Clang does not support BPF load-acquire or addr_space_cast #3/9 arena_atomics/load_acquire:SKIP test_store_release:SKIP:Clang does not support BPF store-release or addr_space_cast #3/10 arena_atomics/store_release:SKIP ... test_load_acquire:SKIP:Clang does not support BPF load-acquire #10/8 atomics/load_acquire:SKIP test_store_release:SKIP:Clang does not support BPF store-release #10/9 atomics/store_release:SKIP Additionally, add several ./test_verifier tests: #65/u atomic BPF_LOAD_ACQ access through non-pointer OK #65/p atomic BPF_LOAD_ACQ access through non-pointer OK #66/u atomic BPF_STORE_REL access through non-pointer OK #66/p atomic BPF_STORE_REL access through non-pointer OK #67/u BPF_ATOMIC load-acquire, 8-bit OK #67/p BPF_ATOMIC load-acquire, 8-bit OK #68/u BPF_ATOMIC load-acquire, 16-bit OK #68/p BPF_ATOMIC load-acquire, 16-bit OK #69/u BPF_ATOMIC load-acquire, 32-bit OK #69/p BPF_ATOMIC load-acquire, 32-bit OK #70/u BPF_ATOMIC load-acquire, 64-bit OK #70/p BPF_ATOMIC load-acquire, 64-bit OK #71/u Cannot load-acquire from uninitialized src_reg OK #71/p Cannot load-acquire from uninitialized src_reg OK #76/u BPF_ATOMIC store-release, 8-bit OK #76/p BPF_ATOMIC store-release, 8-bit OK #77/u BPF_ATOMIC store-release, 16-bit OK #77/p BPF_ATOMIC store-release, 16-bit OK #78/u BPF_ATOMIC store-release, 32-bit OK #78/p BPF_ATOMIC store-release, 32-bit OK #79/u BPF_ATOMIC store-release, 64-bit OK #79/p BPF_ATOMIC store-release, 64-bit OK #80/u Cannot store-release from uninitialized src_reg OK #80/p Cannot store-release from uninitialized src_reg OK Reviewed-by: Josh Don <[email protected]> Signed-off-by: Peilin Ye <[email protected]>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 23, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 23, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 23, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 24, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 25, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 25, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 25, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 25, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 25, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 25, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 25, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 25, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 26, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 26, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 26, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 26, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 26, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 26, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 26, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 26, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 27, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 27, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 27, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 27, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 27, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 27, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
kuba-moo
pushed a commit
to linux-netdev/testing-bpf-ci
that referenced
this pull request
Aug 27, 2026
sctp_unpack_cookie() copies the attacker-supplied sctp_cookie into the new association without validating the length fields of the three embedded AUTH parameters (auth_random, auth_hmacs, auth_chunks) against their fixed in-struct capacities (36/12/20 bytes). When cookie authentication is disabled (net.sctp.cookie_hmac_alg=none), a remote peer can forge a COOKIE-ECHO with an inflated param_hdr.length. The polluted length then drives out-of-bounds reads past the association: n_elt in sctp_auth_asoc_verify_hmac_id() (up to ~64KB of 16-bit probe reads), the key vector memcpy in sctp_auth_make_key_vector() (up to ~64KB source read copied into the HMAC key material), and the chunk-id scan in __sctp_auth_cid(). KASAN reports slab-out-of-bounds reads crossing into unrelated slabs. [ 552.245703] ================================================================== [ 552.245873] BUG: KASAN: slab-out-of-bounds in sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246050] Read of size 2 at addr ffff8881012a90f4 by task poc_guest/333 [ 552.246258] CPU: 1 UID: 0 PID: 333 Comm: poc_guest Tainted: G B 7.2.0-rc6-dirtyfrag-00017-g848acc8ffe1b-dirty kernel-patches#65 PREEMPT(lazy) [ 552.246283] Tainted: [B]=BAD_PAGE [ 552.246291] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-4.tl4 04/01/2014 [ 552.246304] Call Trace: [ 552.246328] <IRQ> [ 552.246344] dump_stack_lvl+0x53/0x70 [ 552.246374] print_report+0xce/0x620 [ 552.246395] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246412] kasan_report+0xce/0x100 [ 552.246430] ? sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246453] sctp_auth_asoc_verify_hmac_id+0x105/0x110 [ 552.246473] sctp_sf_authenticate+0xd2/0x470 [ 552.246491] ? __pfx__raw_spin_lock+0x10/0x10 [ 552.246508] sctp_auth_chunk_verify+0x25b/0x380 [ 552.246526] ? __pfx_sctp_auth_chunk_verify+0x10/0x10 [ 552.246558] ? sctp_auth_asoc_init_active_key+0x1eb/0x810 [ 552.246576] ? sctp_auth_asoc_init_active_key+0x163/0x810 [ 552.246598] sctp_sf_do_5_1D_ce+0x6cf/0x1b50 [ 552.246619] ? __pfx_sctp_sf_do_5_1D_ce+0x10/0x10 [ 552.246637] ? stack_depot_save_flags+0x485/0x7f0 [ 552.246675] ? __pfx_sctp_sm_lookup_event+0x10/0x10 [ 552.246696] sctp_do_sm+0x111/0x5b90 [ 552.246732] ? ip_local_deliver_finish+0x31c/0x4a0 [ 552.246751] ? ip_rcv+0x2ed/0x360 [ 552.246768] ? process_backlog+0x1ea/0x5f0 [ 552.246785] ? __napi_poll+0xa1/0x530 [ 552.246801] ? net_rx_action+0x944/0xfa0 [ 552.246816] ? handle_softirqs+0x1bd/0x620 [ 552.246831] ? do_softirq+0x43/0x60 [ 552.246844] ? __local_bh_enable_ip+0x6a/0x70 [ 552.246858] ? __dev_queue_xmit+0x9f3/0x3470 [ 552.246874] ? ip_finish_output2+0x724/0x1900 [ 552.246889] ? __pfx_sctp_do_sm+0x10/0x10 [ 552.246903] ? raw_sendmsg+0xe72/0x2710 [ 552.246919] ? __x64_sys_sendto+0xe0/0x1c0 [ 552.246938] ? do_syscall_64+0x102/0x5a0 [ 552.246955] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 552.246991] ? __pfx_sctp_epaddr_lookup_transport+0x10/0x10 [ 552.247013] sctp_endpoint_bh_rcv+0x2c4/0x8e0 [ 552.247038] sctp_rcv+0x1545/0x3980 [ 552.247063] ? sock_queue_rcv_skb_reason+0x39/0x70 [ 552.247081] ? __pfx_sctp_rcv+0x10/0x10 [ 552.247105] ? __pfx_raw_local_deliver+0x10/0x10 [ 552.247121] ? lapic_next_event+0x15/0x20 [ 552.247138] ? clockevents_program_event+0x2bf/0x860 [ 552.247159] ip_protocol_deliver_rcu+0x279/0x2f0 [ 552.247176] ? _raw_spin_lock+0x84/0xe0 [ 552.247192] ip_local_deliver_finish+0x31c/0x4a0 [ 552.247211] ip_local_deliver+0x18b/0x2d0 Signed-off-by: NipaLocal <nipa@local>
mrpre
added a commit
to mrpre/bpf
that referenced
this pull request
Sep 6, 2026
bpf_sock_destroy() runs from the tcp iterator, under rcu_read_lock(). If
the sock is a listener that still has children in its accept queue,
tcp_abort() ends up in inet_csk_listen_stop() and the cond_resched()
there trips the debug check:
BUG: sleeping function called from invalid context at net/ipv4/inet_connection_sock.c:1523
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 628, name: test_progs
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
locks held by test_progs/628: 3, last CPU#3:
#0: ffff8881158cee18 (&p->lock){+.+.}-{4:4}, at: bpf_seq_read+0x56/0x1210
#1: ffff8881106bb858 (sk_lock-AF_INET6){+.+.}-{0:0}, at: bpf_iter_tcp_seq_show+0x32b/0x4b0
#2: ffffffffb435af20 (rcu_read_lock){....}-{1:3}, at: bpf_iter_run_prog+0x46b/0xde0
CPU: 3 UID: 0 PID: 628 Comm: test_progs Tainted: G W 7.2.0+ kernel-patches#65 PREEMPT
Tainted: [W]=WARN
Call Trace:
<TASK>
dump_stack_lvl+0xc1/0xf0
dump_stack+0x10/0x20
__might_resched+0x3d2/0x610
inet_csk_listen_stop+0x7b/0xbf0
tcp_abort+0x23b/0x3b0
bpf_sock_destroy+0xfc/0x140
bpf_prog_448133d24601754f_iter_tcp6_server+0x81/0x8a
bpf_iter_run_prog+0x538/0xde0
bpf_iter_tcp_seq_show+0x26b/0x4b0
bpf_seq_read+0x424/0x1210
vfs_read+0x197/0xe40
ksys_read+0x119/0x240
__x64_sys_read+0x72/0xc0
x64_sys_call+0x647/0x27e0
do_syscall_64+0xe5/0x610
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7fad39b28aca
RSP: 002b:00007ffc381c61c0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007ffc381c6a88 RCX: 00007fad39b28aca
RDX: 0000000000000032 RSI: 00007ffc381c6250 RDI: 0000000000000014
RBP: 00007ffc381c61e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000000 R14: 000055f077c1bbb0 R15: 00007fad3a0f3000
</TASK>
The commit that added the kfunc already guards lock_sock() in tcp_abort()
and udp_abort() with has_current_bpf_ctx(), but missed the listener path.
Do the same for the cond_resched(), it can't reschedule there anyway.
Fixes: 4ddbcb8 ("bpf: Add bpf_sock_destroy kfunc")
Signed-off-by: Jiayuan Chen <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
Sep 6, 2026
bpf_sock_destroy() runs from the tcp iterator, under rcu_read_lock(). If
the sock is a listener that still has children in its accept queue,
tcp_abort() ends up in inet_csk_listen_stop() and the cond_resched()
there trips the debug check:
BUG: sleeping function called from invalid context at net/ipv4/inet_connection_sock.c:1523
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 628, name: test_progs
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
locks held by test_progs/628: 3, last CPU#3:
#0: ffff8881158cee18 (&p->lock){+.+.}-{4:4}, at: bpf_seq_read+0x56/0x1210
#1: ffff8881106bb858 (sk_lock-AF_INET6){+.+.}-{0:0}, at: bpf_iter_tcp_seq_show+0x32b/0x4b0
#2: ffffffffb435af20 (rcu_read_lock){....}-{1:3}, at: bpf_iter_run_prog+0x46b/0xde0
CPU: 3 UID: 0 PID: 628 Comm: test_progs Tainted: G W 7.2.0+ #65 PREEMPT
Tainted: [W]=WARN
Call Trace:
<TASK>
dump_stack_lvl+0xc1/0xf0
dump_stack+0x10/0x20
__might_resched+0x3d2/0x610
inet_csk_listen_stop+0x7b/0xbf0
tcp_abort+0x23b/0x3b0
bpf_sock_destroy+0xfc/0x140
bpf_prog_448133d24601754f_iter_tcp6_server+0x81/0x8a
bpf_iter_run_prog+0x538/0xde0
bpf_iter_tcp_seq_show+0x26b/0x4b0
bpf_seq_read+0x424/0x1210
vfs_read+0x197/0xe40
ksys_read+0x119/0x240
__x64_sys_read+0x72/0xc0
x64_sys_call+0x647/0x27e0
do_syscall_64+0xe5/0x610
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7fad39b28aca
RSP: 002b:00007ffc381c61c0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007ffc381c6a88 RCX: 00007fad39b28aca
RDX: 0000000000000032 RSI: 00007ffc381c6250 RDI: 0000000000000014
RBP: 00007ffc381c61e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000000 R14: 000055f077c1bbb0 R15: 00007fad3a0f3000
</TASK>
The commit that added the kfunc already guards lock_sock() in tcp_abort()
and udp_abort() with has_current_bpf_ctx(), but missed the listener path.
Do the same for the cond_resched(), it can't reschedule there anyway.
Fixes: 4ddbcb8 ("bpf: Add bpf_sock_destroy kfunc")
Signed-off-by: Jiayuan Chen <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
Sep 6, 2026
bpf_sock_destroy() runs from the tcp iterator, under rcu_read_lock(). If
the sock is a listener that still has children in its accept queue,
tcp_abort() ends up in inet_csk_listen_stop() and the cond_resched()
there trips the debug check:
BUG: sleeping function called from invalid context at net/ipv4/inet_connection_sock.c:1523
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 628, name: test_progs
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
locks held by test_progs/628: 3, last CPU#3:
#0: ffff8881158cee18 (&p->lock){+.+.}-{4:4}, at: bpf_seq_read+0x56/0x1210
#1: ffff8881106bb858 (sk_lock-AF_INET6){+.+.}-{0:0}, at: bpf_iter_tcp_seq_show+0x32b/0x4b0
#2: ffffffffb435af20 (rcu_read_lock){....}-{1:3}, at: bpf_iter_run_prog+0x46b/0xde0
CPU: 3 UID: 0 PID: 628 Comm: test_progs Tainted: G W 7.2.0+ #65 PREEMPT
Tainted: [W]=WARN
Call Trace:
<TASK>
dump_stack_lvl+0xc1/0xf0
dump_stack+0x10/0x20
__might_resched+0x3d2/0x610
inet_csk_listen_stop+0x7b/0xbf0
tcp_abort+0x23b/0x3b0
bpf_sock_destroy+0xfc/0x140
bpf_prog_448133d24601754f_iter_tcp6_server+0x81/0x8a
bpf_iter_run_prog+0x538/0xde0
bpf_iter_tcp_seq_show+0x26b/0x4b0
bpf_seq_read+0x424/0x1210
vfs_read+0x197/0xe40
ksys_read+0x119/0x240
__x64_sys_read+0x72/0xc0
x64_sys_call+0x647/0x27e0
do_syscall_64+0xe5/0x610
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7fad39b28aca
RSP: 002b:00007ffc381c61c0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007ffc381c6a88 RCX: 00007fad39b28aca
RDX: 0000000000000032 RSI: 00007ffc381c6250 RDI: 0000000000000014
RBP: 00007ffc381c61e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000000 R14: 000055f077c1bbb0 R15: 00007fad3a0f3000
</TASK>
The commit that added the kfunc already guards lock_sock() in tcp_abort()
and udp_abort() with has_current_bpf_ctx(), but missed the listener path.
Do the same for the cond_resched(), it can't reschedule there anyway.
Fixes: 4ddbcb8 ("bpf: Add bpf_sock_destroy kfunc")
Signed-off-by: Jiayuan Chen <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
Sep 6, 2026
bpf_sock_destroy() runs from the tcp iterator, under rcu_read_lock(). If
the sock is a listener that still has children in its accept queue,
tcp_abort() ends up in inet_csk_listen_stop() and the cond_resched()
there trips the debug check:
BUG: sleeping function called from invalid context at net/ipv4/inet_connection_sock.c:1523
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 628, name: test_progs
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
locks held by test_progs/628: 3, last CPU#3:
#0: ffff8881158cee18 (&p->lock){+.+.}-{4:4}, at: bpf_seq_read+0x56/0x1210
#1: ffff8881106bb858 (sk_lock-AF_INET6){+.+.}-{0:0}, at: bpf_iter_tcp_seq_show+0x32b/0x4b0
#2: ffffffffb435af20 (rcu_read_lock){....}-{1:3}, at: bpf_iter_run_prog+0x46b/0xde0
CPU: 3 UID: 0 PID: 628 Comm: test_progs Tainted: G W 7.2.0+ #65 PREEMPT
Tainted: [W]=WARN
Call Trace:
<TASK>
dump_stack_lvl+0xc1/0xf0
dump_stack+0x10/0x20
__might_resched+0x3d2/0x610
inet_csk_listen_stop+0x7b/0xbf0
tcp_abort+0x23b/0x3b0
bpf_sock_destroy+0xfc/0x140
bpf_prog_448133d24601754f_iter_tcp6_server+0x81/0x8a
bpf_iter_run_prog+0x538/0xde0
bpf_iter_tcp_seq_show+0x26b/0x4b0
bpf_seq_read+0x424/0x1210
vfs_read+0x197/0xe40
ksys_read+0x119/0x240
__x64_sys_read+0x72/0xc0
x64_sys_call+0x647/0x27e0
do_syscall_64+0xe5/0x610
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7fad39b28aca
RSP: 002b:00007ffc381c61c0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007ffc381c6a88 RCX: 00007fad39b28aca
RDX: 0000000000000032 RSI: 00007ffc381c6250 RDI: 0000000000000014
RBP: 00007ffc381c61e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000000 R14: 000055f077c1bbb0 R15: 00007fad3a0f3000
</TASK>
The commit that added the kfunc already guards lock_sock() in tcp_abort()
and udp_abort() with has_current_bpf_ctx(), but missed the listener path.
Do the same for the cond_resched(), it can't reschedule there anyway.
Fixes: 4ddbcb8 ("bpf: Add bpf_sock_destroy kfunc")
Signed-off-by: Jiayuan Chen <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
Sep 10, 2026
bpf_sock_destroy() runs from the tcp iterator, under rcu_read_lock(). If
the sock is a listener that still has children in its accept queue,
tcp_abort() ends up in inet_csk_listen_stop() and the cond_resched()
there trips the debug check:
BUG: sleeping function called from invalid context at net/ipv4/inet_connection_sock.c:1523
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 628, name: test_progs
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
locks held by test_progs/628: 3, last CPU#3:
#0: ffff8881158cee18 (&p->lock){+.+.}-{4:4}, at: bpf_seq_read+0x56/0x1210
#1: ffff8881106bb858 (sk_lock-AF_INET6){+.+.}-{0:0}, at: bpf_iter_tcp_seq_show+0x32b/0x4b0
#2: ffffffffb435af20 (rcu_read_lock){....}-{1:3}, at: bpf_iter_run_prog+0x46b/0xde0
CPU: 3 UID: 0 PID: 628 Comm: test_progs Tainted: G W 7.2.0+ #65 PREEMPT
Tainted: [W]=WARN
Call Trace:
<TASK>
dump_stack_lvl+0xc1/0xf0
dump_stack+0x10/0x20
__might_resched+0x3d2/0x610
inet_csk_listen_stop+0x7b/0xbf0
tcp_abort+0x23b/0x3b0
bpf_sock_destroy+0xfc/0x140
bpf_prog_448133d24601754f_iter_tcp6_server+0x81/0x8a
bpf_iter_run_prog+0x538/0xde0
bpf_iter_tcp_seq_show+0x26b/0x4b0
bpf_seq_read+0x424/0x1210
vfs_read+0x197/0xe40
ksys_read+0x119/0x240
__x64_sys_read+0x72/0xc0
x64_sys_call+0x647/0x27e0
do_syscall_64+0xe5/0x610
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7fad39b28aca
RSP: 002b:00007ffc381c61c0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007ffc381c6a88 RCX: 00007fad39b28aca
RDX: 0000000000000032 RSI: 00007ffc381c6250 RDI: 0000000000000014
RBP: 00007ffc381c61e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000000 R14: 000055f077c1bbb0 R15: 00007fad3a0f3000
</TASK>
The commit that added the kfunc already guards lock_sock() in tcp_abort()
and udp_abort() with has_current_bpf_ctx(), but missed the listener path.
Do the same for the cond_resched(). The loop runs inside the iterator's
rcu_read_lock(), it must not reschedule or report a quiescent state there.
Fixes: 4ddbcb8 ("bpf: Add bpf_sock_destroy kfunc")
Signed-off-by: Jiayuan Chen <[email protected]>
kernel-patches-daemon-bpf Bot
pushed a commit
that referenced
this pull request
Sep 11, 2026
bpf_sock_destroy() runs from the tcp iterator, under rcu_read_lock(). If
the sock is a listener that still has children in its accept queue,
tcp_abort() ends up in inet_csk_listen_stop() and the cond_resched()
there trips the debug check:
BUG: sleeping function called from invalid context at net/ipv4/inet_connection_sock.c:1523
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 628, name: test_progs
preempt_count: 0, expected: 0
RCU nest depth: 1, expected: 0
locks held by test_progs/628: 3, last CPU#3:
#0: ffff8881158cee18 (&p->lock){+.+.}-{4:4}, at: bpf_seq_read+0x56/0x1210
#1: ffff8881106bb858 (sk_lock-AF_INET6){+.+.}-{0:0}, at: bpf_iter_tcp_seq_show+0x32b/0x4b0
#2: ffffffffb435af20 (rcu_read_lock){....}-{1:3}, at: bpf_iter_run_prog+0x46b/0xde0
CPU: 3 UID: 0 PID: 628 Comm: test_progs Tainted: G W 7.2.0+ #65 PREEMPT
Tainted: [W]=WARN
Call Trace:
<TASK>
dump_stack_lvl+0xc1/0xf0
dump_stack+0x10/0x20
__might_resched+0x3d2/0x610
inet_csk_listen_stop+0x7b/0xbf0
tcp_abort+0x23b/0x3b0
bpf_sock_destroy+0xfc/0x140
bpf_prog_448133d24601754f_iter_tcp6_server+0x81/0x8a
bpf_iter_run_prog+0x538/0xde0
bpf_iter_tcp_seq_show+0x26b/0x4b0
bpf_seq_read+0x424/0x1210
vfs_read+0x197/0xe40
ksys_read+0x119/0x240
__x64_sys_read+0x72/0xc0
x64_sys_call+0x647/0x27e0
do_syscall_64+0xe5/0x610
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7fad39b28aca
RSP: 002b:00007ffc381c61c0 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 00007ffc381c6a88 RCX: 00007fad39b28aca
RDX: 0000000000000032 RSI: 00007ffc381c6250 RDI: 0000000000000014
RBP: 00007ffc381c61e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000000 R14: 000055f077c1bbb0 R15: 00007fad3a0f3000
</TASK>
The commit that added the kfunc already guards lock_sock() in tcp_abort()
and udp_abort() with has_current_bpf_ctx(), but missed the listener path.
Do the same for the cond_resched(). The loop runs inside the iterator's
rcu_read_lock(), it must not reschedule or report a quiescent state there.
Fixes: 4ddbcb8 ("bpf: Add bpf_sock_destroy kfunc")
Signed-off-by: Jiayuan Chen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: bpf: using rcu_read_lock for bpf_sk_storage_map iterator
version: 2
url: https://patchwork.ozlabs.org/project/netdev/list/?series=201932