[syzbot] [net?] BUG: using smp_processor_id() in preemptible code in sk_skb_reason_drop

13 views
Skip to first unread message

syzbot

unread,
Sep 10, 2026, 4:44:36 PMSep 10
to da...@davemloft.net, edum...@google.com, ho...@kernel.org, ku...@kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, nho...@tuxdriver.com, pab...@redhat.com, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 50d05c7c76c9 Merge tag 'landlock-7.3-rc3' of git://git.ker..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1545c871580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b454dc6b1b7acd30
dashboard link: https://syzkaller.appspot.com/bug?extid=dc57fd6722deb17e92af
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15f6fe01580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17ab2c8e580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7171282977df/disk-50d05c7c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/eb180d9b54d5/vmlinux-50d05c7c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ff1f279b8f9e/bzImage-50d05c7c.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+dc57fd...@syzkaller.appspotmail.com

BUG: using smp_processor_id() in preemptible [00000000] code: syz-executor/5601
caller is net_dm_packet_trace_kfree_skb_hit+0xdf/0x350 net/core/drop_monitor.c:519
CPU: 0 UID: 0 PID: 5601 Comm: syz-executor Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
<TASK>
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
check_preemption_disabled+0xcd/0xd0 lib/smp_processor_id.c:47
net_dm_packet_trace_kfree_skb_hit+0xdf/0x350 net/core/drop_monitor.c:519
__do_trace_kfree_skb include/trace/events/skb.h:24 [inline]
trace_kfree_skb+0x1d1/0x210 include/trace/events/skb.h:24
__sk_skb_reason_drop net/core/skbuff.c:1231 [inline]
sk_skb_reason_drop+0xdd/0x110 net/core/skbuff.c:1249
tcp_data_queue+0xb80/0x5fa0 net/ipv4/tcp_input.c:5709
tcp_rcv_established+0xe45/0x2910 net/ipv4/tcp_input.c:6689
tcp_v4_do_rcv+0x959/0x13f0 net/ipv4/tcp_ipv4.c:1854
sk_backlog_rcv include/net/sock.h:1192 [inline]
__release_sock+0x28e/0x3d0 net/core/sock.c:3263
release_sock+0x1be/0x290 net/core/sock.c:3862
tcp_recvmsg+0x106/0x540 net/ipv4/tcp.c:2946
sock_recvmsg_nosec net/socket.c:1153 [inline]
sock_recvmsg+0x166/0x1e0 net/socket.c:1173
sock_read_iter+0x233/0x300 net/socket.c:1242
new_sync_read fs/read_write.c:493 [inline]
vfs_read+0x59e/0xa90 fs/read_write.c:574
ksys_read+0x156/0x270 fs/read_write.c:716
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f32ab5392d7
Code: 48 89 fa 4c 89 df e8 a8 56 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007ffceb322d90 EFLAGS: 00000202 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000555568ab5540 RCX: 00007f32ab5392d7
RDX: 0000000000000004 RSI: 00007ffceb322dec RDI: 0000000000000003
RBP: 00007ffceb323290 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000004
R13: 00007ffceb322dec R14: 00007ffceb322e80 R15: 0000000000000000
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

jchu...@m.fudan.edu.cn

unread,
Sep 14, 2026, 7:30:09 AMSep 14
to syzbot+dc57fd...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 50d05c7c76c96b90462f24debacca971d2e86713

Reported-by: syzbot+dc57fd...@syzkaller.appspotmail.com

diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index abaf108ac..4c068d613 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -516,6 +516,15 @@ static void net_dm_packet_trace_kfree_skb_hit(void *ignore,
*/
nskb->tstamp = tstamp;

+ /*
+ * The tracepoint can run in preemptible context (e.g. from
+ * tcp_data_queue()). Pin the task to the current CPU before
+ * dereferencing the per-CPU pointer, otherwise this_cpu_ptr()
+ * triggers a "using smp_processor_id() in preemptible code"
+ * splat. migrate_disable() is used instead of preempt_disable()
+ * because the drop_queue spinlock can sleep on PREEMPT_RT.
+ */
+ migrate_disable();
data = this_cpu_ptr(&dm_cpu_data);

spin_lock_irqsave(&data->drop_queue.lock, flags);
@@ -527,6 +536,7 @@ static void net_dm_packet_trace_kfree_skb_hit(void *ignore,

schedule_work(&data->dm_alert_work);

+ migrate_enable();
return;

unlock_free:
@@ -534,6 +544,7 @@ static void net_dm_packet_trace_kfree_skb_hit(void *ignore,
u64_stats_inc(&data->stats.dropped);
u64_stats_update_end(&data->stats.syncp);
spin_unlock_irqrestore(&data->drop_queue.lock, flags);
+ migrate_enable();
consume_skb(nskb);
}

syzbot

unread,
Sep 14, 2026, 12:04:08 PMSep 14
to jchu...@m.fudan.edu.cn, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+dc57fd...@syzkaller.appspotmail.com
Tested-by: syzbot+dc57fd...@syzkaller.appspotmail.com

Tested on:

commit: 50d05c7c Merge tag 'landlock-7.3-rc3' of git://git.ker..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=152a8df9580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b454dc6b1b7acd30
dashboard link: https://syzkaller.appspot.com/bug?extid=dc57fd6722deb17e92af
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=154fe925580000

Note: testing is done by a robot and is best-effort only.

jchu...@m.fudan.edu.cn

unread,
Sep 14, 2026, 9:38:32 PMSep 14
to syzbot+dc57fd...@syzkaller.appspotmail.com, syzkall...@googlegroups.com

syzbot

unread,
Sep 15, 2026, 6:01:08 AMSep 15
to jchu...@m.fudan.edu.cn, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+dc57fd...@syzkaller.appspotmail.com
Tested-by: syzbot+dc57fd...@syzkaller.appspotmail.com

Tested on:

commit: 58785836 Merge tag 'nfsd-7.3-1' of git://git.kernel.or..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16e64df9580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b454dc6b1b7acd30
dashboard link: https://syzkaller.appspot.com/bug?extid=dc57fd6722deb17e92af
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=156e2471580000

jchu...@m.fudan.edu.cn

unread,
Sep 16, 2026, 9:22:53 PMSep 16
to syzbot+dc57fd...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

Reported-by: syzbot+dc57fd...@syzkaller.appspotmail.com

diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index abaf108ac..80b56a47c 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -516,7 +516,14 @@ static void net_dm_packet_trace_kfree_skb_hit(void *ignore,
*/
nskb->tstamp = tstamp;

- data = this_cpu_ptr(&dm_cpu_data);
+ /*
+ * This function may be called from preemptible context (e.g. when
+ * kfree_skb() is called from process context), so use raw_cpu_ptr()
+ * to avoid the debug_smp_processor_id() warning emitted by
+ * this_cpu_ptr(). CPU migration after the pointer is fetched is
+ * harmless because the per-CPU data is serialized by the lock below.
+ */
+ data = raw_cpu_ptr(&dm_cpu_data);

spin_lock_irqsave(&data->drop_queue.lock, flags);
if (skb_queue_len(&data->drop_queue) < net_dm_queue_len)

syzbot

unread,
Sep 17, 2026, 1:25:04 AMSep 17
to jchu...@m.fudan.edu.cn, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+dc57fd...@syzkaller.appspotmail.com
Tested-by: syzbot+dc57fd...@syzkaller.appspotmail.com

Tested on:

commit: 238650ef Merge tag 'powerpc-7.3-4' of git://git.kernel..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1715b925580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b454dc6b1b7acd30
dashboard link: https://syzkaller.appspot.com/bug?extid=dc57fd6722deb17e92af
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=1474ebf9580000
Reply all
Reply to author
Forward
0 new messages