Eric Dumazet
9d9a38b563
net: sched: add rcu annotations around qdisc->qdisc_sleeping
[ Upstream commit d636fc5dd692c8f4e00ae6e0359c0eceeb5d9bdb ]
syzbot reported a race around qdisc->qdisc_sleeping [1]
It is time we add proper annotations to reads and writes to/from
qdisc->qdisc_sleeping.
[1]
BUG: KCSAN: data-race in dev_graft_qdisc / qdisc_lookup_rcu
read to 0xffff8881286fc618 of 8 bytes by task 6928 on cpu 1:
qdisc_lookup_rcu+0x192/0x2c0 net/sched/sch_api.c:331
__tcf_qdisc_find+0x74/0x3c0 net/sched/cls_api.c:1174
tc_get_tfilter+0x18f/0x990 net/sched/cls_api.c:2547
rtnetlink_rcv_msg+0x7af/0x8c0 net/core/rtnetlink.c:6386
netlink_rcv_skb+0x126/0x220 net/netlink/af_netlink.c:2546
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6413
netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
netlink_unicast+0x56f/0x640 net/netlink/af_netlink.c:1365
netlink_sendmsg+0x665/0x770 net/netlink/af_netlink.c:1913
sock_sendmsg_nosec net/socket.c:724 [inline]
sock_sendmsg net/socket.c:747 [inline]
____sys_sendmsg+0x375/0x4c0 net/socket.c:2503
___sys_sendmsg net/socket.c:2557 [inline]
__sys_sendmsg+0x1e3/0x270 net/socket.c:2586
__do_sys_sendmsg net/socket.c:2595 [inline]
__se_sys_sendmsg net/socket.c:2593 [inline]
__x64_sys_sendmsg+0x46/0x50 net/socket.c:2593
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
write to 0xffff8881286fc618 of 8 bytes by task 6912 on cpu 0:
dev_graft_qdisc+0x4f/0x80 net/sched/sch_generic.c:1115
qdisc_graft+0x7d0/0xb60 net/sched/sch_api.c:1103
tc_modify_qdisc+0x712/0xf10 net/sched/sch_api.c:1693
rtnetlink_rcv_msg+0x807/0x8c0 net/core/rtnetlink.c:6395
netlink_rcv_skb+0x126/0x220 net/netlink/af_netlink.c:2546
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6413
netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
netlink_unicast+0x56f/0x640 net/netlink/af_netlink.c:1365
netlink_sendmsg+0x665/0x770 net/netlink/af_netlink.c:1913
sock_sendmsg_nosec net/socket.c:724 [inline]
sock_sendmsg net/socket.c:747 [inline]
____sys_sendmsg+0x375/0x4c0 net/socket.c:2503
___sys_sendmsg net/socket.c:2557 [inline]
__sys_sendmsg+0x1e3/0x270 net/socket.c:2586
__do_sys_sendmsg net/socket.c:2595 [inline]
__se_sys_sendmsg net/socket.c:2593 [inline]
__x64_sys_sendmsg+0x46/0x50 net/socket.c:2593
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 6912 Comm: syz-executor.5 Not tainted 6.4.0-rc3-syzkaller-00190-g0d85b27b0cc6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/16/2023
Fixes: 3a7d0d07a3 ("net: sched: extend Qdisc with rcu")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Vlad Buslov <vladbu@nvidia.com>
Acked-by: Jamal Hadi Salim<jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-14 11:15:21 +02:00
..
2022-11-24 16:01:04 +01:00
2023-02-22 12:59:45 +01:00
2023-01-12 12:02:47 +01:00
2022-12-31 13:32:41 +01:00
2023-03-30 12:49:23 +02:00
2023-05-11 23:03:40 +09:00
2023-03-11 13:55:28 +01:00
2023-03-10 09:33:08 +01:00
2023-05-30 14:03:33 +01:00
2022-11-18 10:39:22 +01:00
2023-01-18 11:58:24 +01:00
2023-05-11 23:03:26 +09:00
2023-02-01 08:34:33 +01:00
2023-05-30 14:03:21 +01:00
2022-12-31 13:33:04 +01:00
2023-05-24 17:32:41 +01:00
2023-01-24 07:24:40 +01:00
2023-06-09 10:34:04 +02:00
2023-03-30 12:49:05 +02:00
2023-02-01 08:34:46 +01:00
2023-05-30 14:03:22 +01:00
2023-05-24 17:32:36 +01:00
2023-05-11 23:03:00 +09:00
2023-05-11 23:03:00 +09:00
2023-03-22 13:33:46 +01:00
2023-03-11 11:03:45 +01:00
2023-03-11 13:55:32 +01:00
2023-01-07 11:11:41 +01:00
2023-03-10 09:33:06 +01:00
2022-12-31 13:33:02 +01:00
2022-12-09 18:41:17 -08:00
2023-03-30 12:49:13 +02:00
2023-03-30 12:49:13 +02:00
2023-05-24 17:32:35 +01:00
2023-05-17 11:53:40 +02:00
2022-12-31 13:31:58 +01:00
2023-01-07 11:11:40 +01:00
2023-04-13 16:55:17 +02:00
2023-03-10 09:33:37 +01:00
2023-05-24 17:32:31 +01:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-04-13 16:55:17 +02:00
2023-02-09 11:28:17 +01:00
2023-01-18 11:58:12 +01:00
2023-01-04 11:28:48 +01:00
2022-11-22 18:50:44 -08:00
2023-03-22 13:34:04 +01:00
2022-12-31 13:32:31 +01:00
2023-01-07 11:11:59 +01:00
2023-05-30 14:03:22 +01:00
2022-11-23 10:31:13 -08:00
2023-04-13 16:55:32 +02:00
2023-03-10 09:33:37 +01:00
2022-11-30 14:49:40 -08:00
2023-03-17 08:50:17 +01:00
2023-02-09 11:28:23 +01:00
2022-12-31 13:32:33 +01:00
2023-02-22 12:59:49 +01:00
2022-12-31 13:32:56 +01:00
2022-12-31 13:32:01 +01:00
2023-05-30 14:03:20 +01:00
2023-05-24 17:32:32 +01:00
2023-03-10 09:34:15 +01:00
2023-03-22 13:33:57 +01:00
2023-04-06 12:10:51 +02:00
2023-03-10 09:32:51 +01:00
2023-04-26 14:28:41 +02:00
2023-03-10 09:33:29 +01:00
2023-03-10 09:34:13 +01:00
2022-11-17 10:50:07 -05:00
2023-03-10 09:34:20 +01:00
2022-11-30 14:49:42 -08:00
2022-11-08 15:57:22 -08:00
2023-01-07 11:12:02 +01:00
2023-02-09 11:28:21 +01:00
2023-03-17 08:50:19 +01:00
2023-04-13 16:55:40 +02:00
2023-02-22 12:59:54 +01:00
2023-05-30 14:03:22 +01:00
2023-06-14 11:15:21 +02:00
2023-03-11 13:55:24 +01:00
2023-03-10 09:33:24 +01:00
2023-02-25 11:25:41 +01:00
2023-03-30 12:49:09 +02:00
2023-01-04 11:28:52 +01:00
2023-02-09 11:28:24 +01:00
2023-03-30 12:49:05 +02:00
2023-01-24 07:24:41 +01:00
2023-05-17 11:53:59 +02:00
2023-04-13 16:55:24 +02:00
2023-03-22 13:33:45 +01:00
2022-11-30 14:49:41 -08:00
2023-04-13 16:55:20 +02:00
2023-05-24 17:32:43 +01:00
2023-03-10 09:33:46 +01:00
2023-05-11 23:03:00 +09:00
2023-01-07 11:11:39 +01:00
2022-12-31 13:32:09 +01:00
2023-02-25 11:25:39 +01:00
2023-04-13 16:55:18 +02:00
2023-02-25 11:25:39 +01:00
2023-03-10 09:33:48 +01:00
2022-11-16 17:13:04 -05:00
2023-03-10 09:34:25 +01:00
2023-03-10 09:32:42 +01:00
2023-03-22 13:33:54 +01:00
2023-02-22 12:59:46 +01:00
2023-06-05 09:26:17 +02:00
2023-06-05 09:26:19 +02:00
2023-03-30 12:49:05 +02:00
2022-12-09 18:41:16 -08:00
2023-03-30 12:49:22 +02:00
2023-02-01 08:34:26 +01:00
2023-05-11 23:03:01 +09:00
2022-12-31 13:31:56 +01:00
2023-01-18 11:58:10 +01:00
2023-05-30 14:03:16 +01:00
2023-02-14 19:11:54 +01:00
2023-04-20 12:35:12 +02:00
2023-03-22 13:33:59 +01:00
2023-03-10 09:33:34 +01:00
2023-03-10 09:33:52 +01:00
2023-02-09 11:28:04 +01:00
2023-05-30 14:03:20 +01:00
2023-02-09 11:28:01 +01:00
2022-11-10 12:03:36 -07:00
2023-05-11 23:03:28 +09:00
2023-03-10 09:34:34 +01:00