Eric Dumazet
d636fc5dd6
net: sched: add rcu annotations around qdisc->qdisc_sleeping
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>
2023-06-07 10:25:39 +01:00
..
2023-03-29 08:22:52 +01:00
2023-05-05 19:12:01 -07:00
2023-05-17 12:55:39 +01:00
2023-05-17 21:27:30 -07:00
2023-04-23 14:16:44 +01:00
2023-06-05 17:24:14 -07:00
2023-04-21 11:34:50 -07:00
2023-05-17 21:28:58 -07:00
2023-03-02 22:22:07 -08:00
2023-06-05 08:26:40 +02:00
2023-02-21 18:24:12 -08:00
2023-06-07 10:25:39 +01:00
2023-01-20 09:33:22 +00:00
2023-03-22 21:50:23 +01:00
2023-05-16 19:57:52 -07:00
2023-04-23 14:16:45 +01:00
2023-05-03 09:13:20 +01:00
2023-05-24 22:05:24 -07:00
2023-03-16 21:11:03 -07:00
2023-03-17 09:13:53 +01:00
2023-06-06 21:07:43 -07:00
2023-06-06 20:59:08 -07:00
2023-03-16 17:34:40 -07:00
2023-01-23 11:26:50 +00:00
2023-05-10 07:04:51 +02:00
2023-03-31 09:25:12 +01:00
2023-05-10 10:03:32 +01:00
2023-06-06 10:20:45 +02:00
2023-04-05 13:48:04 +00:00
2023-03-09 23:06:21 -08:00
2023-02-15 10:26:37 +00:00
2023-06-05 15:15:57 +01:00
2023-04-28 09:35:33 +01:00
2023-06-07 00:43:44 +02:00
2023-05-31 00:02:24 -07:00
2023-05-25 21:02:29 -07:00
2023-03-07 13:37:05 -08:00
2023-05-15 08:40:27 +01:00
2023-04-07 19:42:53 -07:00
2023-05-29 22:03:48 -07:00
2023-01-23 11:26:50 +00:00
2023-04-13 09:35:30 +02:00
2023-02-13 09:33:39 +00:00
2023-04-06 20:36:27 +02:00
2023-01-28 00:19:57 -08:00
2023-05-30 10:01:06 +02:00
2023-06-07 10:25:39 +01:00
2023-05-22 11:05:20 +01:00
2023-06-03 20:51:04 +01:00
2023-05-22 12:01:13 -07:00
2023-05-15 10:21:20 +01:00
2023-05-26 10:35:58 +01:00
2023-05-23 16:09:47 +02:00
2023-05-23 16:09:47 +02:00
2023-06-06 14:51:32 +02:00
2023-01-25 09:51:04 +00:00
2023-04-13 16:43:38 -07:00
2023-05-16 20:52:35 -07:00
2023-04-14 11:09:27 +01:00
2023-04-19 18:48:48 -07:00
2023-04-19 18:48:48 -07:00
2023-05-10 09:58:29 +01:00