* [syzbot] [net?] BUG: corrupted list in flow_block_cb_setup_simple @ 2025-09-12 7:06 syzbot 2025-09-12 9:30 ` Hillf Danton 2026-02-06 18:28 ` Forwarded: Test for 5a66db916cdde0dbcc1c syzbot 0 siblings, 2 replies; 4+ messages in thread From: syzbot @ 2025-09-12 7:06 UTC (permalink / raw) To: davem, edumazet, horms, kuba, linux-kernel, netdev, pabeni, syzkaller-bugs Hello, syzbot found the following issue on: HEAD commit: e59a039119c3 Merge tag 's390-6.17-4' of git://git.kernel.o.. git tree: bpf console output: https://syzkaller.appspot.com/x/log.txt?x=1523e934580000 kernel config: https://syzkaller.appspot.com/x/.config?x=4d8792ecb6308d0f dashboard link: https://syzkaller.appspot.com/bug?extid=5a66db916cdde0dbcc1c compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16d4bd62580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10d69642580000 Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/324da524bbd8/disk-e59a0391.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/0fa38e1d54f4/vmlinux-e59a0391.xz kernel image: https://storage.googleapis.com/syzbot-assets/b1ea8074daa0/bzImage-e59a0391.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+5a66db916cdde0dbcc1c@syzkaller.appspotmail.com non-slab/vmalloc memory list_del corruption. prev->next should be ffff888077fdb100, but was ffffffff8edac9a0. (prev=ffffffff8edac9a0) ------------[ cut here ]------------ kernel BUG at lib/list_debug.c:64! Oops: invalid opcode: 0000 [#1] SMP KASAN PTI CPU: 0 UID: 0 PID: 6449 Comm: syz.3.301 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025 RIP: 0010:__list_del_entry_valid_or_report+0x15a/0x190 lib/list_debug.c:62 Code: e8 4b a5 31 fd 43 80 3c 2c 00 74 08 4c 89 ff e8 1c 9d 52 fd 49 8b 17 48 c7 c7 a0 40 e3 8b 48 89 de 4c 89 f9 e8 07 0b 57 fc 90 <0f> 0b 4c 89 f7 e8 1c a5 31 fd 43 80 3c 2c 00 74 08 4c 89 ff e8 ed RSP: 0018:ffffc90003f4e760 EFLAGS: 00010246 RAX: 000000000000006d RBX: ffff888077fdb100 RCX: 21dc4908dd936700 RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000 RBP: 1ffff920007e9d3e R08: ffffc90003f4e487 R09: 1ffff920007e9c90 R10: dffffc0000000000 R11: fffff520007e9c91 R12: 1ffffffff1db5934 R13: dffffc0000000000 R14: ffffffff8edac9a0 R15: ffffffff8edac9a0 FS: 00005555769e1500(0000) GS:ffff888125c15000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000200000000380 CR3: 0000000030806000 CR4: 00000000003526f0 Call Trace: <TASK> __list_del_entry_valid include/linux/list.h:124 [inline] __list_del_entry include/linux/list.h:215 [inline] list_del include/linux/list.h:229 [inline] flow_block_cb_setup_simple+0x62d/0x740 net/core/flow_offload.c:369 nft_block_offload_cmd net/netfilter/nf_tables_offload.c:397 [inline] nft_chain_offload_cmd+0x290/0x660 net/netfilter/nf_tables_offload.c:451 nft_flow_block_chain net/netfilter/nf_tables_offload.c:471 [inline] nft_flow_offload_chain net/netfilter/nf_tables_offload.c:513 [inline] nft_flow_rule_offload_commit+0x40d/0x1b60 net/netfilter/nf_tables_offload.c:592 nf_tables_commit+0x675/0x8700 net/netfilter/nf_tables_api.c:10933 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:574 [inline] nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:647 [inline] nfnetlink_rcv+0x1a4e/0x2520 net/netfilter/nfnetlink.c:665 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82f/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x219/0x270 net/socket.c:729 ____sys_sendmsg+0x505/0x830 net/socket.c:2614 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668 __sys_sendmsg net/socket.c:2700 [inline] __do_sys_sendmsg net/socket.c:2705 [inline] __se_sys_sendmsg net/socket.c:2703 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2703 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe1b0d8eba9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc23fb3798 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fe1b0fd5fa0 RCX: 00007fe1b0d8eba9 RDX: 000000000000c050 RSI: 0000200000000cc0 RDI: 0000000000000003 RBP: 00007fe1b0e11e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fe1b0fd5fa0 R14: 00007fe1b0fd5fa0 R15: 0000000000000003 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:__list_del_entry_valid_or_report+0x15a/0x190 lib/list_debug.c:62 Code: e8 4b a5 31 fd 43 80 3c 2c 00 74 08 4c 89 ff e8 1c 9d 52 fd 49 8b 17 48 c7 c7 a0 40 e3 8b 48 89 de 4c 89 f9 e8 07 0b 57 fc 90 <0f> 0b 4c 89 f7 e8 1c a5 31 fd 43 80 3c 2c 00 74 08 4c 89 ff e8 ed RSP: 0018:ffffc90003f4e760 EFLAGS: 00010246 RAX: 000000000000006d RBX: ffff888077fdb100 RCX: 21dc4908dd936700 RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000 RBP: 1ffff920007e9d3e R08: ffffc90003f4e487 R09: 1ffff920007e9c90 R10: dffffc0000000000 R11: fffff520007e9c91 R12: 1ffffffff1db5934 R13: dffffc0000000000 R14: ffffffff8edac9a0 R15: ffffffff8edac9a0 FS: 00005555769e1500(0000) GS:ffff888125c15000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000200000000380 CR3: 0000000030806000 CR4: 00000000003526f0 --- 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 syzkaller@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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [syzbot] [net?] BUG: corrupted list in flow_block_cb_setup_simple 2025-09-12 7:06 [syzbot] [net?] BUG: corrupted list in flow_block_cb_setup_simple syzbot @ 2025-09-12 9:30 ` Hillf Danton 2025-09-12 12:45 ` syzbot 2026-02-06 18:28 ` Forwarded: Test for 5a66db916cdde0dbcc1c syzbot 1 sibling, 1 reply; 4+ messages in thread From: Hillf Danton @ 2025-09-12 9:30 UTC (permalink / raw) To: syzbot; +Cc: linux-kernel, syzkaller-bugs > Date: Fri, 12 Sep 2025 00:06:29 -0700 [thread overview] > Hello, > > syzbot found the following issue on: > > HEAD commit: e59a039119c3 Merge tag 's390-6.17-4' of git://git.kernel.o.. > git tree: bpf > console output: https://syzkaller.appspot.com/x/log.txt?x=1523e934580000 > kernel config: https://syzkaller.appspot.com/x/.config?x=4d8792ecb6308d0f > dashboard link: https://syzkaller.appspot.com/bug?extid=5a66db916cdde0dbcc1c > compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16d4bd62580000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10d69642580000 #syz test upstream master --- x/net/core/flow_offload.c +++ y/net/core/flow_offload.c @@ -334,6 +334,7 @@ bool flow_block_cb_is_busy(flow_setup_cb } EXPORT_SYMBOL(flow_block_cb_is_busy); +static DEFINE_MUTEX(setup_lock); int flow_block_cb_setup_simple(struct flow_block_offload *f, struct list_head *driver_block_list, flow_setup_cb_t *cb, @@ -348,27 +349,37 @@ int flow_block_cb_setup_simple(struct fl f->driver_block_list = driver_block_list; + mutex_lock(&setup_lock); switch (f->command) { case FLOW_BLOCK_BIND: - if (flow_block_cb_is_busy(cb, cb_ident, driver_block_list)) + if (flow_block_cb_is_busy(cb, cb_ident, driver_block_list)) { + mutex_unlock(&setup_lock); return -EBUSY; + } block_cb = flow_block_cb_alloc(cb, cb_ident, cb_priv, NULL); - if (IS_ERR(block_cb)) + if (IS_ERR(block_cb)) { + mutex_unlock(&setup_lock); return PTR_ERR(block_cb); + } flow_block_cb_add(block_cb, f); list_add_tail(&block_cb->driver_list, driver_block_list); + mutex_unlock(&setup_lock); return 0; case FLOW_BLOCK_UNBIND: block_cb = flow_block_cb_lookup(f->block, cb, cb_ident); - if (!block_cb) + if (!block_cb) { + mutex_unlock(&setup_lock); return -ENOENT; + } flow_block_cb_remove(block_cb, f); list_del(&block_cb->driver_list); + mutex_unlock(&setup_lock); return 0; default: + mutex_unlock(&setup_lock); return -EOPNOTSUPP; } } -- ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [syzbot] [net?] BUG: corrupted list in flow_block_cb_setup_simple 2025-09-12 9:30 ` Hillf Danton @ 2025-09-12 12:45 ` syzbot 0 siblings, 0 replies; 4+ messages in thread From: syzbot @ 2025-09-12 12:45 UTC (permalink / raw) To: hdanton, linux-kernel, syzkaller-bugs Hello, syzbot has tested the proposed patch and the reproducer did not trigger any issue: Reported-by: syzbot+5a66db916cdde0dbcc1c@syzkaller.appspotmail.com Tested-by: syzbot+5a66db916cdde0dbcc1c@syzkaller.appspotmail.com Tested on: commit: 320475fb Merge tag 'mtd/fixes-for-6.17-rc6' of git://g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1236eb12580000 kernel config: https://syzkaller.appspot.com/x/.config?x=4d8792ecb6308d0f dashboard link: https://syzkaller.appspot.com/bug?extid=5a66db916cdde0dbcc1c compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8 patch: https://syzkaller.appspot.com/x/patch.diff?x=148cb362580000 Note: testing is done by a robot and is best-effort only. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Forwarded: Test for 5a66db916cdde0dbcc1c 2025-09-12 7:06 [syzbot] [net?] BUG: corrupted list in flow_block_cb_setup_simple syzbot 2025-09-12 9:30 ` Hillf Danton @ 2026-02-06 18:28 ` syzbot 1 sibling, 0 replies; 4+ messages in thread From: syzbot @ 2026-02-06 18:28 UTC (permalink / raw) To: linux-kernel For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: Test for 5a66db916cdde0dbcc1c Author: syoshida@redhat.com #syz test diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index 596ab9791e4d..ff6d2bcb2cca 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -673,6 +673,8 @@ int flow_block_cb_setup_simple(struct flow_block_offload *f, flow_setup_cb_t *cb, void *cb_ident, void *cb_priv, bool ingress_only); +void flow_block_cb_remove_driver(struct flow_block_cb *block_cb); + enum flow_cls_command { FLOW_CLS_REPLACE, FLOW_CLS_DESTROY, diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c index bc5169482710..137a44af5e1c 100644 --- a/net/core/flow_offload.c +++ b/net/core/flow_offload.c @@ -334,6 +334,8 @@ bool flow_block_cb_is_busy(flow_setup_cb_t *cb, void *cb_ident, } EXPORT_SYMBOL(flow_block_cb_is_busy); +static DEFINE_MUTEX(flow_block_cb_list_lock); + int flow_block_cb_setup_simple(struct flow_block_offload *f, struct list_head *driver_block_list, flow_setup_cb_t *cb, @@ -341,6 +343,7 @@ int flow_block_cb_setup_simple(struct flow_block_offload *f, bool ingress_only) { struct flow_block_cb *block_cb; + int err = 0; if (ingress_only && f->binder_type != FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS) @@ -348,32 +351,52 @@ int flow_block_cb_setup_simple(struct flow_block_offload *f, f->driver_block_list = driver_block_list; + mutex_lock(&flow_block_cb_list_lock); + switch (f->command) { case FLOW_BLOCK_BIND: - if (flow_block_cb_is_busy(cb, cb_ident, driver_block_list)) - return -EBUSY; + if (flow_block_cb_is_busy(cb, cb_ident, driver_block_list)) { + err = -EBUSY; + break; + } block_cb = flow_block_cb_alloc(cb, cb_ident, cb_priv, NULL); - if (IS_ERR(block_cb)) - return PTR_ERR(block_cb); + if (IS_ERR(block_cb)) { + err = PTR_ERR(block_cb); + break; + } flow_block_cb_add(block_cb, f); list_add_tail(&block_cb->driver_list, driver_block_list); - return 0; + break; case FLOW_BLOCK_UNBIND: block_cb = flow_block_cb_lookup(f->block, cb, cb_ident); - if (!block_cb) - return -ENOENT; + if (!block_cb) { + err = -ENOENT; + break; + } flow_block_cb_remove(block_cb, f); list_del(&block_cb->driver_list); - return 0; + break; default: - return -EOPNOTSUPP; + err = -EOPNOTSUPP; + break; } + + mutex_unlock(&flow_block_cb_list_lock); + return err; } EXPORT_SYMBOL(flow_block_cb_setup_simple); +void flow_block_cb_remove_driver(struct flow_block_cb *block_cb) +{ + mutex_lock(&flow_block_cb_list_lock); + list_del(&block_cb->driver_list); + mutex_unlock(&flow_block_cb_list_lock); +} +EXPORT_SYMBOL(flow_block_cb_remove_driver); + static DEFINE_MUTEX(flow_indr_block_lock); static LIST_HEAD(flow_block_indr_list); static LIST_HEAD(flow_block_indr_dev_list); diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c index fd30e205de84..d60838bceafb 100644 --- a/net/netfilter/nf_tables_offload.c +++ b/net/netfilter/nf_tables_offload.c @@ -414,7 +414,7 @@ static void nft_indr_block_cleanup(struct flow_block_cb *block_cb) basechain, &extack); nft_net = nft_pernet(net); mutex_lock(&nft_net->commit_mutex); - list_del(&block_cb->driver_list); + flow_block_cb_remove_driver(block_cb); list_move(&block_cb->list, &bo.cb_list); nft_flow_offload_unbind(&bo, basechain); mutex_unlock(&nft_net->commit_mutex); ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-06 18:28 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-09-12 7:06 [syzbot] [net?] BUG: corrupted list in flow_block_cb_setup_simple syzbot 2025-09-12 9:30 ` Hillf Danton 2025-09-12 12:45 ` syzbot 2026-02-06 18:28 ` Forwarded: Test for 5a66db916cdde0dbcc1c syzbot
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.