Eric Dumazet
9bb363ba01
net_sched: add __rcu annotation to netdev->qdisc
commit 5891cd5ec46c2c2eb6427cb54d214b149635dd0e upstream.
syzbot found a data-race [1] which lead me to add __rcu
annotations to netdev->qdisc, and proper accessors
to get LOCKDEP support.
[1]
BUG: KCSAN: data-race in dev_activate / qdisc_lookup_rcu
write to 0xffff888168ad6410 of 8 bytes by task 13559 on cpu 1:
attach_default_qdiscs net/sched/sch_generic.c:1167 [inline]
dev_activate+0x2ed/0x8f0 net/sched/sch_generic.c:1221
__dev_open+0x2e9/0x3a0 net/core/dev.c:1416
__dev_change_flags+0x167/0x3f0 net/core/dev.c:8139
rtnl_configure_link+0xc2/0x150 net/core/rtnetlink.c:3150
__rtnl_newlink net/core/rtnetlink.c:3489 [inline]
rtnl_newlink+0xf4d/0x13e0 net/core/rtnetlink.c:3529
rtnetlink_rcv_msg+0x745/0x7e0 net/core/rtnetlink.c:5594
netlink_rcv_skb+0x14e/0x250 net/netlink/af_netlink.c:2494
rtnetlink_rcv+0x18/0x20 net/core/rtnetlink.c:5612
netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline]
netlink_unicast+0x602/0x6d0 net/netlink/af_netlink.c:1343
netlink_sendmsg+0x728/0x850 net/netlink/af_netlink.c:1919
sock_sendmsg_nosec net/socket.c:705 [inline]
sock_sendmsg net/socket.c:725 [inline]
____sys_sendmsg+0x39a/0x510 net/socket.c:2413
___sys_sendmsg net/socket.c:2467 [inline]
__sys_sendmsg+0x195/0x230 net/socket.c:2496
__do_sys_sendmsg net/socket.c:2505 [inline]
__se_sys_sendmsg net/socket.c:2503 [inline]
__x64_sys_sendmsg+0x42/0x50 net/socket.c:2503
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
read to 0xffff888168ad6410 of 8 bytes by task 13560 on cpu 0:
qdisc_lookup_rcu+0x30/0x2e0 net/sched/sch_api.c:323
__tcf_qdisc_find+0x74/0x3a0 net/sched/cls_api.c:1050
tc_del_tfilter+0x1c7/0x1350 net/sched/cls_api.c:2211
rtnetlink_rcv_msg+0x5ba/0x7e0 net/core/rtnetlink.c:5585
netlink_rcv_skb+0x14e/0x250 net/netlink/af_netlink.c:2494
rtnetlink_rcv+0x18/0x20 net/core/rtnetlink.c:5612
netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline]
netlink_unicast+0x602/0x6d0 net/netlink/af_netlink.c:1343
netlink_sendmsg+0x728/0x850 net/netlink/af_netlink.c:1919
sock_sendmsg_nosec net/socket.c:705 [inline]
sock_sendmsg net/socket.c:725 [inline]
____sys_sendmsg+0x39a/0x510 net/socket.c:2413
___sys_sendmsg net/socket.c:2467 [inline]
__sys_sendmsg+0x195/0x230 net/socket.c:2496
__do_sys_sendmsg net/socket.c:2505 [inline]
__se_sys_sendmsg net/socket.c:2503 [inline]
__x64_sys_sendmsg+0x42/0x50 net/socket.c:2503
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
value changed: 0xffffffff85dee080 -> 0xffff88815d96ec00
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 13560 Comm: syz-executor.2 Not tainted 5.17.0-rc3-syzkaller-00116-gf1baf68e1383-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Fixes: 470502de5b ("net: sched: unlock rules update API")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Vlad Buslov <vladbu@mellanox.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-23 12:03:12 +01:00
..
2021-08-19 15:07:03 +02:00
2021-09-02 22:49:16 +02:00
2021-11-18 19:17:06 +01:00
2021-08-13 09:38:04 +02:00
2022-01-27 11:02:57 +01:00
2021-08-23 18:05:31 -04:00
2021-09-07 12:38:59 -07:00
2021-12-08 09:04:54 +01:00
2021-08-31 16:43:06 -07:00
2022-01-27 11:02:49 +01:00
2021-09-03 16:20:37 -07:00
2021-09-20 12:43:34 +01:00
2021-11-25 09:48:24 +01:00
2021-09-01 15:25:28 -07:00
2021-08-23 11:06:28 +01:00
2021-11-25 09:49:07 +01:00
2021-09-07 14:02:58 -07:00
2021-09-01 10:29:29 -07:00
2021-10-14 12:47:29 +01:00
2021-08-29 14:47:42 +03:00
2021-09-04 10:25:26 -07:00
2021-11-18 19:15:59 +01:00
2022-02-01 17:27:07 +01:00
2021-12-08 09:04:41 +01:00
2021-10-07 16:51:57 +02:00
2021-09-03 09:58:10 -07:00
2021-09-03 10:08:28 -07:00
2021-08-31 09:41:22 -07:00
2021-08-13 10:27:49 +02:00
2021-08-31 09:41:22 -07:00
2021-08-16 10:53:01 -06:00
2021-08-23 12:54:30 -06:00
2022-01-27 11:04:15 +01:00
2022-02-01 17:27:03 +01:00
2021-09-09 19:14:33 -04:00
2021-10-26 12:35:16 -07:00
2022-01-27 11:03:27 +01:00
2021-11-18 19:16:20 +01:00
2021-12-14 10:57:09 +01:00
2021-08-20 00:09:49 +02:00
2021-08-25 19:41:39 -07:00
2021-09-24 16:13:35 -07:00
2021-08-16 10:50:32 -06:00
2021-09-01 10:29:10 +02:00
2021-11-18 19:17:21 +01:00
2021-09-13 16:35:58 -07:00
2021-09-13 16:35:58 -07:00
2021-09-01 15:26:45 -07:00
2021-09-03 09:58:17 -07:00
2021-09-08 15:32:35 -07:00
2021-09-13 10:43:04 -07:00
2021-09-12 16:09:26 -07:00
2021-09-13 10:18:28 -07:00
2021-09-13 10:43:04 -07:00
2021-12-29 12:28:49 +01:00
2021-11-18 19:16:03 +01:00
2021-08-18 22:33:28 +02:00
2021-09-11 00:41:21 +02:00
2021-11-18 19:16:45 +01:00
2021-10-18 20:22:03 -10:00
2021-09-21 17:34:53 +02:00
2021-08-20 12:32:59 +02:00
2021-08-24 17:09:01 -05:00
2021-09-08 11:50:24 -07:00
2021-08-26 16:52:03 -07:00
2021-08-17 17:29:10 +02:00
2021-12-14 10:57:11 +01:00
2021-08-31 14:55:09 -07:00
2021-09-03 10:34:44 -07:00
2021-11-18 19:16:00 +01:00
2021-08-18 13:27:49 +02:00
2021-08-19 09:02:39 +02:00
2021-08-14 09:18:36 +02:00
2021-11-25 09:48:41 +01:00
2022-01-05 12:42:34 +01:00
2021-10-18 20:22:03 -10:00
2021-09-07 21:17:28 +02:00
2021-08-19 11:19:41 +01:00
2021-08-26 15:32:28 -04:00
2021-10-05 12:38:39 +01:00
2021-11-18 19:17:06 +01:00
2021-08-24 07:38:29 -07:00
2021-08-28 01:33:02 +02:00
2021-08-20 11:39:26 +01:00
2021-08-26 15:32:10 -04:00
2022-01-11 15:35:16 +01:00
2021-09-06 07:20:56 -04:00
2021-12-14 10:57:09 +01:00
2021-11-18 19:16:25 +01:00
2022-01-20 09:13:13 +01:00
2021-11-25 09:49:08 +01:00
2021-08-27 13:34:02 +01:00
2022-01-11 15:35:11 +01:00
2022-02-01 17:27:15 +01:00
2021-09-23 19:26:54 +02:00
2021-10-15 21:02:50 -06:00
2022-01-27 11:04:41 +01:00
2021-09-08 11:50:24 -07:00
2021-09-03 09:58:13 -07:00
2021-09-03 09:58:16 -07:00
2021-09-08 18:45:53 -07:00
2021-08-12 17:26:24 +02:00
2021-08-26 10:18:56 +02:00
2021-08-13 06:41:22 -07:00
2021-12-29 12:28:49 +01:00
2021-08-19 10:41:08 +02:00
2021-08-19 10:41:08 +02:00
2021-08-23 13:10:37 -06:00
2021-08-20 17:14:35 +02:00
2021-08-16 21:26:33 -07:00
2021-09-03 10:44:35 -07:00
2021-08-18 07:23:15 -06:00
2021-11-25 09:48:42 +01:00
2022-01-27 11:05:05 +01:00
2021-09-22 14:29:32 +01:00
2021-11-18 19:16:13 +01:00
2021-08-19 09:02:55 +09:00
2021-11-12 15:05:49 +01:00
2021-12-08 09:04:41 +01:00
2022-02-08 18:34:12 +01:00
2021-09-06 06:30:45 -04:00
2021-08-18 08:27:30 +02:00
2021-11-18 19:15:51 +01:00
2021-08-13 18:37:38 +02:00
2021-08-17 19:08:49 +02:00
2021-11-12 15:05:48 +01:00
2021-11-12 15:05:48 +01:00
2021-09-19 12:08:37 +01:00
2022-01-05 12:42:33 +01:00
2022-02-16 12:56:38 +01:00
2021-09-08 11:50:23 -07:00
2021-10-18 20:22:02 -10:00
2021-09-03 09:58:17 -07:00
2021-12-14 10:57:22 +01:00
2021-09-24 16:13:35 -07:00
2021-08-19 13:06:53 +01:00
2021-08-19 09:02:55 +09:00
2022-02-01 17:27:05 +01:00
2021-09-03 18:42:01 +02:00
2021-09-16 13:05:42 -07:00
2021-08-20 12:32:58 +02:00
2022-01-27 11:03:00 +01:00
2021-08-26 10:36:51 -06:00
2021-08-16 14:42:22 +02:00
2021-11-18 19:17:14 +01:00
2021-08-17 19:05:29 +02:00
2021-08-23 13:19:12 +02:00
2022-02-23 12:03:12 +01:00
2021-08-25 15:20:25 +01:00
2022-02-16 12:56:09 +01:00
2022-02-16 12:56:08 +01:00
2022-02-16 12:56:09 +01:00
2021-08-16 18:55:32 +02:00
2021-09-14 09:02:50 +02:00
2022-01-27 11:04:15 +01:00
2021-09-07 12:27:27 -07:00
2021-08-25 15:43:26 -05:00
2021-09-08 11:50:25 -07:00
2021-09-13 10:18:28 -07:00
2021-09-17 13:52:17 +01:00
2021-09-08 11:50:24 -07:00
2021-09-08 11:50:24 -07:00
2021-10-28 17:18:55 -07:00
2021-09-08 12:55:35 -07:00
2021-08-18 17:32:42 -05:00
2021-09-07 19:13:42 -07:00
2021-09-02 17:59:58 +02:00
2021-08-19 14:13:28 +01:00
2021-09-07 19:13:42 -07:00
2021-11-21 13:44:14 +01:00
2022-02-01 17:27:10 +01:00
2022-02-08 18:34:05 +01:00
2021-09-07 14:04:59 +01:00
2021-08-18 11:39:46 -07:00
2021-09-20 22:28:47 +02:00
2021-08-18 16:08:11 +02:00
2021-08-26 11:28:07 -07:00
2021-08-16 18:45:29 +02:00
2022-01-27 11:04:44 +01:00
2021-08-18 22:08:24 +02:00
2021-11-18 19:17:14 +01:00
2021-08-14 12:48:07 +02:00
2021-08-17 19:06:04 +02:00
2021-11-25 09:48:45 +01:00
2022-02-01 17:27:01 +01:00
2022-02-01 17:27:15 +01:00
2022-01-27 11:03:52 +01:00
2021-09-02 21:38:56 +02:00
2021-10-07 16:51:57 +02:00
2021-08-17 17:36:48 +02:00
2021-08-17 17:36:48 +02:00
2021-08-26 13:40:35 +01:00
2021-11-18 19:16:58 +01:00
2021-08-17 17:37:26 +02:00
2021-08-17 17:12:22 +02:00
2021-08-17 17:50:51 +02:00
2021-08-17 17:50:51 +02:00
2021-09-02 22:07:17 +02:00
2021-08-24 19:52:40 -03:00
2022-02-23 12:03:07 +01:00
2021-10-18 20:22:03 -10:00
2021-11-12 15:05:48 +01:00
2021-11-18 19:17:12 +01:00
2021-08-13 09:12:53 +02:00
2021-08-13 09:14:36 +02:00
2021-09-03 09:58:12 -07:00
2021-11-18 19:16:01 +01:00
2021-12-08 09:04:47 +01:00
2022-01-27 11:04:02 +01:00
2021-11-18 19:16:45 +01:00
2021-09-04 10:22:01 +02:00
2021-08-31 16:43:06 -07:00
2021-08-17 17:43:24 +02:00
2021-08-17 19:06:13 +02:00
2021-08-17 19:06:13 +02:00
2021-08-17 19:06:13 +02:00
2021-08-17 17:43:24 +02:00
2021-08-17 11:47:43 +02:00
2021-08-17 19:09:27 +02:00
2021-08-19 09:02:55 +09:00
2022-01-27 11:03:21 +01:00
2021-11-21 13:44:12 +01:00
2022-02-16 12:56:19 +01:00
2021-09-03 09:58:17 -07:00
2021-09-09 13:25:49 -07:00
2021-08-17 11:47:53 -04:00
2021-12-29 12:28:54 +01:00
2021-08-14 15:43:28 +02:00
2021-09-08 11:50:28 -07:00
2021-09-08 17:44:26 +02:00
2021-11-18 19:16:41 +01:00
2021-11-25 09:48:34 +01:00
2021-10-18 18:12:09 -04:00
2021-09-22 10:24:01 -04:00
2021-08-16 11:37:21 -04:00
2021-09-08 15:32:35 -07:00
2021-09-15 09:22:35 -06:00
2021-09-08 12:55:35 -07:00
2021-10-18 16:02:30 -05:00
2021-09-03 09:58:16 -07:00
2021-09-06 07:20:57 -04:00
2021-08-26 10:36:51 -06:00
2021-09-06 07:20:57 -04:00
2021-12-29 12:28:43 +01:00
2021-09-03 09:58:16 -07:00
2021-09-08 11:50:24 -07:00
2021-09-03 09:58:17 -07:00
2021-12-14 10:57:15 +01:00
2021-08-22 10:28:08 +02:00
2021-09-13 07:53:27 -10:00
2021-09-03 10:08:28 -07:00
2021-08-17 19:05:11 +02:00