Eric Dumazet
f1a3b283f8
net_sched: sch_fq: better validate TCA_FQ_WEIGHTS and TCA_FQ_PRIOMAP
...
syzbot was able to trigger the following report while providing
too small TCA_FQ_WEIGHTS attribute [1]
Fix is to use NLA_POLICY_EXACT_LEN() to ensure user space
provided correct sizes.
Apply the same fix to TCA_FQ_PRIOMAP.
[1]
BUG: KMSAN: uninit-value in fq_load_weights net/sched/sch_fq.c:960 [inline]
BUG: KMSAN: uninit-value in fq_change+0x1348/0x2fe0 net/sched/sch_fq.c:1071
fq_load_weights net/sched/sch_fq.c:960 [inline]
fq_change+0x1348/0x2fe0 net/sched/sch_fq.c:1071
fq_init+0x68e/0x780 net/sched/sch_fq.c:1159
qdisc_create+0x12f3/0x1be0 net/sched/sch_api.c:1326
tc_modify_qdisc+0x11ef/0x2c20
rtnetlink_rcv_msg+0x16a6/0x1840 net/core/rtnetlink.c:6558
netlink_rcv_skb+0x371/0x650 net/netlink/af_netlink.c:2545
rtnetlink_rcv+0x34/0x40 net/core/rtnetlink.c:6576
netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline]
netlink_unicast+0xf47/0x1250 net/netlink/af_netlink.c:1368
netlink_sendmsg+0x1238/0x13d0 net/netlink/af_netlink.c:1910
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9c2/0xd60 net/socket.c:2588
___sys_sendmsg+0x28d/0x3c0 net/socket.c:2642
__sys_sendmsg net/socket.c:2671 [inline]
__do_sys_sendmsg net/socket.c:2680 [inline]
__se_sys_sendmsg net/socket.c:2678 [inline]
__x64_sys_sendmsg+0x307/0x490 net/socket.c:2678
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Uninit was created at:
slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768
slab_alloc_node mm/slub.c:3478 [inline]
kmem_cache_alloc_node+0x5e9/0xb10 mm/slub.c:3523
kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:560
__alloc_skb+0x318/0x740 net/core/skbuff.c:651
alloc_skb include/linux/skbuff.h:1286 [inline]
netlink_alloc_large_skb net/netlink/af_netlink.c:1214 [inline]
netlink_sendmsg+0xb34/0x13d0 net/netlink/af_netlink.c:1885
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9c2/0xd60 net/socket.c:2588
___sys_sendmsg+0x28d/0x3c0 net/socket.c:2642
__sys_sendmsg net/socket.c:2671 [inline]
__do_sys_sendmsg net/socket.c:2680 [inline]
__se_sys_sendmsg net/socket.c:2678 [inline]
__x64_sys_sendmsg+0x307/0x490 net/socket.c:2678
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b
CPU: 1 PID: 5001 Comm: syz-executor300 Not tainted 6.6.0-syzkaller-12401-g8f6f76a6a29f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
Fixes: 29f834aa326e ("net_sched: sch_fq: add 3 bands and WRR scheduling")
Fixes: 49e7265fd098 ("net_sched: sch_fq: add TCA_FQ_WEIGHTS attribute")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Jamal Hadi Salim<jhs@mojatatu.com>
Link: https://lore.kernel.org/r/20231107160440.1992526-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-11-08 18:30:21 -08:00
..
2023-11-06 08:56:25 +00:00
2022-12-09 09:18:07 +00:00
2023-03-01 08:19:09 +00:00
2023-04-19 13:04:30 +01:00
2023-11-08 17:47:08 -08:00
2023-02-13 20:09:01 -08:00
2022-12-13 15:47:48 -08:00
2023-11-01 21:49:08 -07:00
2022-12-09 09:18:07 +00:00
2023-06-29 12:10:37 +02:00
2023-05-01 07:26:10 +01:00
2023-03-22 22:43:23 -07:00
2023-02-16 10:39:28 +01:00
2023-07-04 10:31:38 +02:00
2023-06-10 00:11:41 -07:00
2023-02-26 18:27:45 +00:00
2022-12-09 09:18:07 +00:00
2022-12-09 09:18:07 +00:00
2022-12-09 09:18:07 +00:00
2023-03-30 23:24:24 -07:00
2022-12-09 09:18:07 +00:00
2023-11-06 08:56:25 +00:00
2023-11-01 21:49:09 -07:00
2023-07-17 07:33:39 +01:00
2023-11-01 21:49:09 -07:00
2022-12-25 13:38:09 -08:00
2023-08-03 14:34:37 -07:00
2023-11-01 21:49:09 -07:00
2023-07-17 07:33:38 +01:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2020-07-13 17:20:40 -07:00
2020-11-10 17:00:28 -08:00
2020-07-03 14:34:53 -07:00
2020-07-03 14:34:53 -07:00
2023-10-01 19:09:54 +01:00
2021-02-06 11:15:28 -08:00
2022-12-19 09:43:18 +00:00
2023-07-19 10:07:27 -07:00
2023-02-16 09:27:07 +01:00
2023-08-23 09:44:48 +01:00
2020-07-16 16:48:34 -07:00
2023-06-10 00:11:41 -07:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2022-09-01 08:06:45 +02:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2022-10-19 13:47:09 +01:00
2023-10-26 16:24:09 -07:00
2023-11-08 18:30:21 -08:00
2023-09-12 11:42:25 +02:00
2023-10-05 13:27:31 +02:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2022-09-01 08:06:45 +02:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2023-06-07 10:25:39 +01:00
2023-11-01 21:49:09 -07:00
2023-04-13 22:22:10 -07:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2023-06-07 10:25:39 +01:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2022-10-20 17:24:59 -07:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00
2023-11-01 21:49:09 -07:00