Eric Dumazet
5611a00697
ipmr,ip6mr: acquire RTNL before calling ip[6]mr_free_table() on failure path
...
ip[6]mr_free_table() can only be called under RTNL lock.
RTNL: assertion failed at net/core/dev.c (10367)
WARNING: CPU: 1 PID: 5890 at net/core/dev.c:10367 unregister_netdevice_many+0x1246/0x1850 net/core/dev.c:10367
Modules linked in:
CPU: 1 PID: 5890 Comm: syz-executor.2 Not tainted 5.16.0-syzkaller-11627-g422ee58dc0ef #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:unregister_netdevice_many+0x1246/0x1850 net/core/dev.c:10367
Code: 0f 85 9b ee ff ff e8 69 07 4b fa ba 7f 28 00 00 48 c7 c6 00 90 ae 8a 48 c7 c7 40 90 ae 8a c6 05 6d b1 51 06 01 e8 8c 90 d8 01 <0f> 0b e9 70 ee ff ff e8 3e 07 4b fa 4c 89 e7 e8 86 2a 59 fa e9 ee
RSP: 0018:ffffc900046ff6e0 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff888050f51d00 RSI: ffffffff815fa008 RDI: fffff520008dfece
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff815f3d6e R11: 0000000000000000 R12: 00000000fffffff4
R13: dffffc0000000000 R14: ffffc900046ff750 R15: ffff88807b7dc000
FS: 00007f4ab736e700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fee0b4f8990 CR3: 000000001e7d2000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
mroute_clean_tables+0x244/0xb40 net/ipv6/ip6mr.c:1509
ip6mr_free_table net/ipv6/ip6mr.c:389 [inline]
ip6mr_rules_init net/ipv6/ip6mr.c:246 [inline]
ip6mr_net_init net/ipv6/ip6mr.c:1306 [inline]
ip6mr_net_init+0x3f0/0x4e0 net/ipv6/ip6mr.c:1298
ops_init+0xaf/0x470 net/core/net_namespace.c:140
setup_net+0x54f/0xbb0 net/core/net_namespace.c:331
copy_net_ns+0x318/0x760 net/core/net_namespace.c:475
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
copy_namespaces+0x391/0x450 kernel/nsproxy.c:178
copy_process+0x2e0c/0x7300 kernel/fork.c:2167
kernel_clone+0xe7/0xab0 kernel/fork.c:2555
__do_sys_clone+0xc8/0x110 kernel/fork.c:2672
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f4ab89f9059
Code: Unable to access opcode bytes at RIP 0x7f4ab89f902f.
RSP: 002b:00007f4ab736e118 EFLAGS: 00000206 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 00007f4ab8b0bf60 RCX: 00007f4ab89f9059
RDX: 0000000020000280 RSI: 0000000020000270 RDI: 0000000040200000
RBP: 00007f4ab8a5308d R08: 0000000020000300 R09: 0000000020000300
R10: 00000000200002c0 R11: 0000000000000206 R12: 0000000000000000
R13: 00007ffc3977cc1f R14: 00007f4ab736e300 R15: 0000000000022000
</TASK>
Fixes: f243e5a7859a ("ipmr,ip6mr: call ip6mr_free_table() on failure path")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Cong Wang <cong.wang@bytedance.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Link: https://lore.kernel.org/r/20220208053451.2885398-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-02-08 20:49:52 -08:00
..
2020-08-10 12:06:44 -07:00
2022-01-27 18:53:02 -08:00
2022-01-06 17:08:35 -08:00
2021-06-30 15:51:09 -07:00
2021-11-22 14:34:07 +00:00
2021-12-10 15:56:13 -08:00
2021-09-19 12:43:56 +01:00
2021-09-29 11:39:33 +01:00
2021-12-06 16:05:11 -08:00
2021-11-16 13:16:54 +00:00
2021-07-20 16:14:23 +02:00
2021-12-02 11:56:04 +00:00
2021-06-07 14:08:30 -07:00
2021-09-28 17:32:56 -07:00
2021-12-16 07:18:35 -08:00
2022-01-19 08:14:40 -08:00
2021-07-20 06:00:38 -07:00
2021-11-24 17:21:42 -08:00
2021-05-17 15:29:35 -07:00
2021-11-24 17:21:42 -08:00
2021-10-14 07:54:47 -07:00
2021-11-14 12:20:44 +00:00
2021-12-09 13:23:02 -08:00
2021-12-10 21:14:49 -08:00
2022-01-13 13:06:05 +00:00
2021-11-10 16:29:58 -08:00
2020-08-19 14:06:36 +02:00
2021-03-01 13:32:12 -08:00
2022-01-13 13:06:05 +00:00
2022-01-11 20:36:08 -08:00
2021-02-03 14:51:39 -08:00
2020-08-25 06:28:02 -07:00
2022-01-27 08:37:02 -08:00
2021-11-20 14:11:00 +00:00
2021-01-08 19:25:35 -08:00
2021-10-13 09:41:37 -07:00
2021-10-13 09:41:37 -07:00
2021-06-30 15:51:09 -07:00
2021-10-28 14:36:41 +01:00
2021-10-13 09:41:37 -07:00
2022-02-08 20:49:52 -08:00
2020-08-18 16:02:16 -07:00
2021-02-26 12:28:03 -08:00
2020-11-16 08:08:54 -08:00
2021-04-18 22:04:16 +02:00
2021-12-29 08:48:14 -08:00
2022-01-24 12:30:12 +00:00
2021-12-01 19:06:09 -08:00
2021-05-17 15:29:35 -07:00
2021-07-13 09:28:29 -07:00
2022-01-27 20:58:39 +02:00
2022-01-04 12:40:22 +00:00
2021-11-16 19:07:54 -08:00
2021-09-23 12:50:26 +01:00
2021-10-05 17:07:41 -07:00
2022-01-05 20:43:08 +01:00
2021-05-04 11:58:28 -07:00
2021-11-24 17:26:05 -08:00
2021-10-05 17:07:41 -07:00
2021-09-20 13:09:06 +01:00
2020-07-06 13:23:03 -07:00
2020-07-06 13:23:03 -07:00
2022-02-02 16:22:37 -08:00
2022-01-27 20:58:39 +02:00
2021-03-28 17:31:13 -07:00
2020-12-14 16:40:27 -08:00
2021-12-03 14:15:49 +00:00
2021-09-27 12:47:39 +01:00
2021-11-16 13:16:54 +00:00
2021-12-01 19:06:09 -08:00
2021-09-24 14:16:40 +01:00
2021-07-27 20:07:21 +01:00
2020-08-24 17:31:20 -07:00
2021-06-29 11:28:21 -07:00
2020-10-13 17:11:52 -07:00
2020-07-06 13:23:03 -07:00
2021-06-29 11:54:36 -07:00
2022-02-04 20:07:12 -08:00
2021-05-17 15:29:35 -07:00
2021-10-26 12:29:33 -07:00
2021-07-13 09:28:29 -07:00
2020-07-24 15:41:54 -07:00
2021-11-24 17:21:42 -08:00
2021-09-21 10:17:20 +01:00
2021-09-13 12:38:45 +01:00
2020-07-10 13:54:00 -07:00
2022-01-22 08:33:37 +02:00
2021-05-17 15:29:35 -07:00
2020-05-11 15:12:27 +02:00
2021-12-09 11:51:45 -08:00
2021-05-17 15:29:35 -07:00
2021-09-23 10:10:00 +02:00