Eric Dumazet
7072a355ba
netfilter: nfnetlink: add a missing rcu_read_unlock()
...
Reported by syzbot :
BUG: sleeping function called from invalid context at include/linux/sched/mm.h:201
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 26899, name: syz-executor.5
1 lock held by syz-executor.5/26899:
#0 : ffffffff8bf797a0 (rcu_read_lock){....}-{1:2}, at: nfnetlink_get_subsys net/netfilter/nfnetlink.c:148 [inline]
#0 : ffffffff8bf797a0 (rcu_read_lock){....}-{1:2}, at: nfnetlink_rcv_msg+0x1da/0x1300 net/netfilter/nfnetlink.c:226
Preemption disabled at:
[<ffffffff8917799e>] preempt_schedule_irq+0x3e/0x90 kernel/sched/core.c:5533
CPU: 1 PID: 26899 Comm: syz-executor.5 Not tainted 5.12.0-next-20210504-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:79 [inline]
dump_stack+0x141/0x1d7 lib/dump_stack.c:120
___might_sleep.cold+0x1f1/0x237 kernel/sched/core.c:8338
might_alloc include/linux/sched/mm.h:201 [inline]
slab_pre_alloc_hook mm/slab.h:500 [inline]
slab_alloc_node mm/slub.c:2845 [inline]
kmem_cache_alloc_node+0x33d/0x3e0 mm/slub.c:2960
__alloc_skb+0x20b/0x340 net/core/skbuff.c:413
alloc_skb include/linux/skbuff.h:1107 [inline]
nlmsg_new include/net/netlink.h:953 [inline]
netlink_ack+0x1ed/0xaa0 net/netlink/af_netlink.c:2437
netlink_rcv_skb+0x33d/0x420 net/netlink/af_netlink.c:2508
nfnetlink_rcv+0x1ac/0x420 net/netfilter/nfnetlink.c:650
netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline]
netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1338
netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1927
sock_sendmsg_nosec net/socket.c:654 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:674
____sys_sendmsg+0x6e8/0x810 net/socket.c:2350
___sys_sendmsg+0xf3/0x170 net/socket.c:2404
__sys_sendmsg+0xe5/0x1b0 net/socket.c:2433
do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x4665f9
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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa8a03ee188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 00000000004665f9
RDX: 0000000000000000 RSI: 0000000020000480 RDI: 0000000000000004
RBP: 00000000004bfce1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60
R13: 00007fffe864480f R14: 00007fa8a03ee300 R15: 0000000000022000
================================================
WARNING: lock held when returning to user space!
5.12.0-next-20210504-syzkaller #0 Tainted: G W
------------------------------------------------
syz-executor.5/26899 is leaving the kernel with locks still held!
1 lock held by syz-executor.5/26899:
#0 : ffffffff8bf797a0 (rcu_read_lock){....}-{1:2}, at: nfnetlink_get_subsys net/netfilter/nfnetlink.c:148 [inline]
#0 : ffffffff8bf797a0 (rcu_read_lock){....}-{1:2}, at: nfnetlink_rcv_msg+0x1da/0x1300 net/netfilter/nfnetlink.c:226
------------[ cut here ]------------
WARNING: CPU: 0 PID: 26899 at kernel/rcu/tree_plugin.h:359 rcu_note_context_switch+0xfd/0x16e0 kernel/rcu/tree_plugin.h:359
Modules linked in:
CPU: 0 PID: 26899 Comm: syz-executor.5 Tainted: G W 5.12.0-next-20210504-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:rcu_note_context_switch+0xfd/0x16e0 kernel/rcu/tree_plugin.h:359
Code: 48 89 fa 48 c1 ea 03 0f b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 2e 0d 00 00 8b bd cc 03 00 00 85 ff 7e 02 <0f> 0b 65 48 8b 2c 25 00 f0 01 00 48 8d bd cc 03 00 00 48 b8 00 00
RSP: 0000:ffffc90002fffdb0 EFLAGS: 00010002
RAX: 0000000000000007 RBX: ffff8880b9c36080 RCX: ffffffff8dc99bac
RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000001
RBP: ffff88808b9d1c80 R08: 0000000000000000 R09: ffffffff8dc96917
R10: fffffbfff1b92d22 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88808b9d1c80 R14: ffff88808b9d1c80 R15: ffffc90002ff8000
FS: 00007fa8a03ee700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f09896ed000 CR3: 0000000032070000 CR4: 00000000001526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__schedule+0x214/0x23e0 kernel/sched/core.c:5044
schedule+0xcf/0x270 kernel/sched/core.c:5226
exit_to_user_mode_loop kernel/entry/common.c:162 [inline]
exit_to_user_mode_prepare+0x13e/0x280 kernel/entry/common.c:208
irqentry_exit_to_user_mode+0x5/0x40 kernel/entry/common.c:314
asm_sysvec_reschedule_ipi+0x12/0x20 arch/x86/include/asm/idtentry.h:637
RIP: 0033:0x4665f9
Fixes: 50f2db9e368f ("netfilter: nfnetlink: consolidate callback types")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2021-05-05 17:26:02 +02:00
..
2021-04-26 18:16:56 +02:00
2021-04-03 20:17:11 +02:00
2020-10-12 01:57:34 +02:00
2021-04-26 18:16:56 +02:00
2021-03-31 22:34:10 +02:00
2019-05-21 10:50:45 +02:00
2021-03-28 17:31:14 -07:00
2019-07-16 13:16:59 +02:00
2019-07-16 13:16:59 +02:00
2021-04-13 13:10:39 +02:00
2021-04-06 00:34:53 +02:00
2021-04-13 13:10:39 +02:00
2019-12-17 22:59:31 +01:00
2020-07-16 12:35:15 -07:00
2020-07-22 01:18:05 +02:00
2019-07-16 13:16:59 +02:00
2019-06-19 17:09:52 +02:00
2021-04-13 13:10:39 +02:00
2019-07-16 13:16:59 +02:00
2019-08-27 18:07:03 +02:00
2019-05-30 11:26:32 -07:00
2021-04-26 18:16:56 +02:00
2020-08-28 20:11:38 +02:00
2021-03-18 00:32:48 +01:00
2019-06-19 17:09:55 +02:00
2021-03-18 00:32:06 +01:00
2020-05-27 22:20:34 +02:00
2020-05-27 22:20:34 +02:00
2020-12-12 11:44:42 +01:00
2021-04-13 13:10:39 +02:00
2020-08-29 13:03:06 +02:00
2021-04-26 03:20:07 +02:00
2019-07-16 13:16:59 +02:00
2019-05-31 18:02:45 +02:00
2019-07-16 13:16:59 +02:00
2019-05-30 11:26:32 -07:00
2021-04-19 15:49:50 -07:00
2019-07-16 13:16:59 +02:00
2019-09-13 12:33:06 +02:00
2019-05-24 17:37:51 +02:00
2020-10-22 14:49:36 +02:00
2021-04-13 13:47:00 +02:00
2020-06-25 00:50:31 +02:00
2021-03-31 22:34:11 +02:00
2021-04-19 15:49:50 -07:00
2020-05-27 22:20:34 +02:00
2021-04-26 03:20:47 +02:00
2021-03-31 22:34:11 +02:00
2019-07-16 13:16:59 +02:00
2021-04-26 03:20:07 +02:00
2019-07-16 13:16:59 +02:00
2019-06-22 08:59:24 -04:00
2019-07-16 13:16:59 +02:00
2019-04-11 20:59:34 +02:00
2021-04-26 03:20:07 +02:00
2019-06-22 08:59:24 -04:00
2019-07-16 13:16:59 +02:00
2019-07-16 13:16:59 +02:00
2020-03-29 16:28:29 +02:00
2020-07-24 15:41:54 -07:00
2020-12-16 11:01:04 -08:00
2021-04-27 18:06:29 +02:00
2020-10-04 21:08:33 +02:00
2021-04-26 03:58:17 +02:00
2021-03-31 22:34:11 +02:00
2021-04-26 18:16:56 +02:00
2021-04-26 18:16:56 +02:00
2021-04-26 18:16:56 +02:00
2021-04-26 18:16:56 +02:00
2021-04-26 18:16:56 +02:00
2021-04-26 18:16:56 +02:00
2021-05-05 17:26:02 +02:00
2021-01-27 23:16:02 +01:00
2021-01-27 23:16:02 +01:00
2021-04-26 03:58:17 +02:00
2020-03-06 18:00:43 +01:00
2020-10-30 12:57:39 +01:00
2021-04-18 22:02:21 +02:00
2021-04-26 18:16:56 +02:00
2020-06-25 00:50:31 +02:00
2021-04-18 22:04:49 +02:00
2021-03-18 00:32:48 +01:00
2021-01-27 22:53:29 +01:00
2021-04-26 03:58:17 +02:00
2021-01-27 23:16:02 +01:00
2020-06-25 00:50:31 +02:00
2020-06-25 00:50:31 +02:00
2021-01-27 23:16:02 +01:00
2021-03-24 12:48:39 -07:00
2021-01-27 22:53:29 +01:00
2021-01-27 23:16:02 +01:00
2021-01-27 23:16:02 +01:00
2021-04-10 21:15:35 +02:00
2021-03-31 22:34:11 +02:00
2021-04-27 18:06:29 +02:00
2021-01-27 22:53:29 +01:00
2021-01-27 23:16:02 +01:00
2021-01-27 22:53:29 +01:00
2021-01-27 23:16:02 +01:00
2021-04-27 18:06:29 +02:00
2021-01-27 23:16:02 +01:00
2021-04-18 22:02:21 +02:00
2021-01-27 22:53:29 +01:00
2020-06-25 00:50:31 +02:00
2021-01-27 22:53:29 +01:00
2021-01-27 22:53:29 +01:00
2020-12-01 14:33:55 +01:00
2020-10-31 10:41:00 +01:00
2020-10-31 10:40:42 +01:00
2021-01-27 23:16:02 +01:00
2020-04-05 23:26:36 +02:00
2021-04-27 18:06:29 +02:00
2020-03-15 15:27:46 +01:00
2020-04-09 00:12:48 +09:00
2021-04-27 18:06:29 +02:00
2020-03-15 15:27:46 +01:00
2021-04-27 18:06:29 +02:00
2021-04-27 22:34:05 +02:00
2020-06-25 00:50:31 +02:00
2021-04-26 03:20:07 +02:00
2021-01-27 23:16:02 +01:00
2021-01-27 23:16:02 +01:00
2020-10-30 12:57:39 +01:00
2021-04-26 18:16:56 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 10:50:45 +02:00
2018-02-14 21:05:38 +01:00
2019-06-19 17:09:55 +02:00
2019-09-13 12:33:06 +02:00
2020-07-29 20:09:18 +02:00
2020-07-29 20:09:18 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-22 08:59:24 -04:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-03-15 15:20:16 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-22 08:59:24 -04:00
2020-08-28 19:55:51 +02:00
2020-04-05 23:26:37 +02:00
2019-05-30 11:26:32 -07:00
2019-06-25 01:32:59 +02:00
2019-05-21 10:50:45 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:38 -07:00
2019-06-19 17:09:55 +02:00
2021-04-26 18:16:56 +02:00
2021-03-31 22:34:10 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-06-25 00:50:31 +02:00
2019-06-19 17:09:55 +02:00
2020-12-01 09:45:29 +01:00
2021-03-31 22:34:10 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 11:28:45 +02:00
2019-06-25 01:32:59 +02:00
2019-09-13 12:32:48 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 10:50:45 +02:00
2019-06-19 17:09:55 +02:00
2020-12-27 11:52:26 +01:00
2019-06-19 17:09:55 +02:00
2021-02-04 00:33:08 +01:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2019-05-21 10:50:45 +02:00
2021-05-03 23:02:44 +02:00
2019-08-13 12:14:26 +02:00
2021-04-26 03:20:07 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-22 08:59:24 -04:00
2019-06-22 08:59:24 -04:00
2019-05-21 10:50:45 +02:00
2019-05-21 11:28:40 +02:00
2020-07-29 20:09:18 +02:00
2021-04-26 03:20:07 +02:00
2021-03-31 22:34:10 +02:00
2019-05-21 10:50:45 +02:00