syzbot


kernel panic: corrupted stack end in tcp_setsockopt

Status: internal: reported on 2022/06/15 15:52
Reported-by: syzbot+@syzkaller.appspotmail.com
Fix commit: b81d591386c3 riscv: Increase stack size under KASAN
Patched on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 234d, last: 86d

Sample crash report:
Kernel panic - not syncing: corrupted stack end detected inside scheduler
CPU: 0 PID: 2031 Comm: syz-executor.0 Not tainted 5.17.0-rc1-syzkaller-00002-g0966d385830d #0
Hardware name: riscv-virtio,qemu (DT)
Call Trace:
[<ffffffff8000a228>] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:113
[<ffffffff831668cc>] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:119
[<ffffffff831756ba>] __dump_stack lib/dump_stack.c:88 [inline]
[<ffffffff831756ba>] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:106
[<ffffffff83175742>] dump_stack+0x1c/0x24 lib/dump_stack.c:113
[<ffffffff83166fa8>] panic+0x24a/0x634 kernel/panic.c:233
[<ffffffff831a688a>] schedule_debug kernel/sched/core.c:5541 [inline]
[<ffffffff831a688a>] schedule+0x0/0x14c kernel/sched/core.c:6187
[<ffffffff831a6c62>] preempt_schedule_notrace+0x9c/0x19a kernel/sched/core.c:6541
[<ffffffff80115c54>] rcu_read_unlock_sched_notrace include/linux/rcupdate.h:816 [inline]
[<ffffffff80115c54>] trace_lock_release include/trace/events/lock.h:58 [inline]
[<ffffffff80115c54>] lock_release+0x3da/0x614 kernel/locking/lockdep.c:5650
[<ffffffff831a7d4c>] __mutex_unlock_slowpath+0xa4/0x3a2 kernel/locking/mutex.c:893
[<ffffffff831a8058>] mutex_unlock+0xe/0x16 kernel/locking/mutex.c:540
[<ffffffff803a7b6c>] pcpu_alloc+0xd50/0x1278 mm/percpu.c:1874
[<ffffffff803a80f2>] __alloc_percpu+0x28/0x34 mm/percpu.c:1949
[<ffffffff82aa74f4>] xt_percpu_counter_alloc+0xee/0x106 net/netfilter/x_tables.c:1930
[<ffffffff82c62bae>] find_check_entry.constprop.0+0xc8/0x55e net/ipv4/netfilter/ip_tables.c:528
[<ffffffff82c64176>] translate_table+0x7ae/0xc24 net/ipv4/netfilter/ip_tables.c:718
[<ffffffff82c6677c>] do_replace.constprop.0+0x28c/0x7fe net/ipv4/netfilter/ip_tables.c:1136
[<ffffffff82c66f96>] do_ipt_set_ctl+0x2a8/0x51e net/ipv4/netfilter/ip_tables.c:1630
[<ffffffff829a1420>] nf_setsockopt+0x6c/0xac net/netfilter/nf_sockopt.c:101
[<ffffffff82b0561a>] ip_setsockopt+0x102/0x10c net/ipv4/ip_sockglue.c:1444
[<ffffffff82b2704e>] tcp_setsockopt+0x76/0xb2 net/ipv4/tcp.c:3685
[<ffffffff826da07c>] sock_common_setsockopt+0x6a/0x7c net/core/sock.c:3489
[<ffffffff826d7740>] __sys_setsockopt+0x1d2/0x3e0 net/socket.c:2180
[<ffffffff826d7988>] __do_sys_setsockopt net/socket.c:2191 [inline]
[<ffffffff826d7988>] sys_setsockopt+0x3a/0x4c net/socket.c:2188
[<ffffffff80005716>] ret_from_syscall+0x0/0x2
SMP: stopping secondary CPUs
Rebooting in 86400 seconds..

Crashes (3):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-qemu2-riscv64 2022/11/11 06:53 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d f42ee5d8 .config console log report info kernel panic: corrupted stack end in tcp_setsockopt
ci-qemu2-riscv64 2022/09/02 02:57 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d a805568e .config console log report info kernel panic: corrupted stack end in tcp_setsockopt
ci-qemu2-riscv64 2022/06/15 15:51 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 0966d385830d 1719ee24 .config console log report info kernel panic: corrupted stack end in tcp_setsockopt
* Struck through repros no longer work on HEAD.