Eric Dumazet
faf9d46542
net-caif: avoid user-triggerable WARN_ON(1)
...
commit 550ac9c1aaaaf51fd42e20d461f0b1cdbd55b3d2 upstream.
syszbot triggers this warning, which looks something
we can easily prevent.
If we initialize priv->list_field in chnl_net_init(),
then always use list_del_init(), we can remove robust_list_del()
completely.
WARNING: CPU: 0 PID: 3233 at net/caif/chnl_net.c:67 robust_list_del net/caif/chnl_net.c:67 [inline]
WARNING: CPU: 0 PID: 3233 at net/caif/chnl_net.c:67 chnl_net_uninit+0xc9/0x2e0 net/caif/chnl_net.c:375
Modules linked in:
CPU: 0 PID: 3233 Comm: syz-executor.3 Not tainted 5.14.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:robust_list_del net/caif/chnl_net.c:67 [inline]
RIP: 0010:chnl_net_uninit+0xc9/0x2e0 net/caif/chnl_net.c:375
Code: 89 eb e8 3a a3 ba f8 48 89 d8 48 c1 e8 03 42 80 3c 28 00 0f 85 bf 01 00 00 48 81 fb 00 14 4e 8d 48 8b 2b 75 d0 e8 17 a3 ba f8 <0f> 0b 5b 5d 41 5c 41 5d e9 0a a3 ba f8 4c 89 e3 e8 02 a3 ba f8 4c
RSP: 0018:ffffc90009067248 EFLAGS: 00010202
RAX: 0000000000008780 RBX: ffffffff8d4e1400 RCX: ffffc9000fd34000
RDX: 0000000000040000 RSI: ffffffff88bb6e49 RDI: 0000000000000003
RBP: ffff88802cd9ee08 R08: 0000000000000000 R09: ffffffff8d0e6647
R10: ffffffff88bb6dc2 R11: 0000000000000000 R12: ffff88803791ae08
R13: dffffc0000000000 R14: 00000000e600ffce R15: ffff888073ed3480
FS: 00007fed10fa0700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2c322000 CR3: 00000000164a6000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
register_netdevice+0xadf/0x1500 net/core/dev.c:10347
ipcaif_newlink+0x4c/0x260 net/caif/chnl_net.c:468
__rtnl_newlink+0x106d/0x1750 net/core/rtnetlink.c:3458
rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3506
rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5572
netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504
netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340
netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929
sock_sendmsg_nosec net/socket.c:704 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:724
__sys_sendto+0x21c/0x320 net/socket.c:2036
__do_sys_sendto net/socket.c:2048 [inline]
__se_sys_sendto net/socket.c:2044 [inline]
__x64_sys_sendto+0xdd/0x1b0 net/socket.c:2044
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
Fixes: cc36a070b590 ("net-caif: add CAIF netdevice")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-22 12:26:40 +02:00
..
2021-09-15 09:47:31 +02:00
2021-09-22 12:26:20 +02:00
2021-07-31 08:19:38 +02:00
2021-01-17 14:05:31 +01:00
2021-04-07 14:47:41 +02:00
2020-10-01 13:17:58 +02:00
2020-07-31 18:39:31 +02:00
2021-06-23 14:41:23 +02:00
2021-09-22 12:26:33 +02:00
2019-07-25 18:00:41 -07:00
2021-07-14 16:53:33 +02:00
2021-08-18 08:57:00 +02:00
2021-09-22 12:26:40 +02:00
2021-08-04 12:27:40 +02:00
2020-11-05 11:43:34 +01:00
2021-09-22 12:26:29 +02:00
2021-01-23 15:57:59 +01:00
2021-08-26 08:36:16 -04:00
2021-07-28 13:30:56 +02:00
2020-04-23 10:36:45 +02:00
2021-06-03 08:59:12 +02:00
2020-01-09 10:20:06 +01:00
2021-05-14 09:44:10 +02:00
2021-08-18 08:57:00 +02:00
2019-09-26 08:56:17 +02:00
2021-09-22 12:26:33 +02:00
2021-09-15 09:47:37 +02:00
2021-03-07 12:20:42 +01:00
2019-09-27 10:27:14 +02:00
2021-02-13 13:52:54 +01:00
2020-07-22 09:32:47 +02:00
2021-02-10 09:25:28 +01:00
2021-08-04 12:27:39 +02:00
2021-09-22 12:26:32 +02:00
2021-04-14 08:24:18 +02:00
2021-03-17 17:03:31 +01:00
2021-04-14 08:24:15 +02:00
2021-09-03 10:08:12 +02:00
2021-09-22 12:26:36 +02:00
2021-09-22 12:26:27 +02:00
2021-07-28 13:30:56 +02:00
2021-06-16 11:59:33 +02:00
2021-08-26 08:36:19 -04:00
2021-06-30 08:47:48 -04:00
2019-10-28 13:33:41 -07:00
2019-12-04 22:30:54 +01:00
2021-09-03 10:08:12 +02:00
2021-09-03 10:08:15 +02:00
2020-11-24 13:29:05 +01:00
2020-12-08 10:40:23 +01:00
2021-02-17 10:35:18 +01:00
2021-09-22 12:26:36 +02:00
2021-08-12 13:20:57 +02:00
2021-06-03 08:59:08 +02:00
2021-09-22 12:26:33 +02:00
2021-02-07 15:35:46 +01:00
2021-09-22 12:26:40 +02:00
2021-07-14 16:53:31 +02:00
2021-07-31 08:19:37 +02:00
2021-08-18 08:57:01 +02:00
2019-08-10 15:25:47 -07:00
2021-08-04 12:27:38 +02:00
2021-06-18 09:59:00 +02:00
2021-05-22 11:38:27 +02:00
2021-07-19 08:53:11 +02:00
2021-06-18 09:59:00 +02:00
2020-04-01 11:02:18 +02:00
2021-09-03 10:08:16 +02:00