Eric Dumazet
8738c85c72
sch_choke: avoid potential panic in choke_reset()
...
If choke_init() could not allocate q->tab, we would crash later
in choke_reset().
BUG: KASAN: null-ptr-deref in memset include/linux/string.h:366 [inline]
BUG: KASAN: null-ptr-deref in choke_reset+0x208/0x340 net/sched/sch_choke.c:326
Write of size 8 at addr 0000000000000000 by task syz-executor822/7022
CPU: 1 PID: 7022 Comm: syz-executor822 Not tainted 5.7.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x188/0x20d lib/dump_stack.c:118
__kasan_report.cold+0x5/0x4d mm/kasan/report.c:515
kasan_report+0x33/0x50 mm/kasan/common.c:625
check_memory_region_inline mm/kasan/generic.c:187 [inline]
check_memory_region+0x141/0x190 mm/kasan/generic.c:193
memset+0x20/0x40 mm/kasan/common.c:85
memset include/linux/string.h:366 [inline]
choke_reset+0x208/0x340 net/sched/sch_choke.c:326
qdisc_reset+0x6b/0x520 net/sched/sch_generic.c:910
dev_deactivate_queue.constprop.0+0x13c/0x240 net/sched/sch_generic.c:1138
netdev_for_each_tx_queue include/linux/netdevice.h:2197 [inline]
dev_deactivate_many+0xe2/0xba0 net/sched/sch_generic.c:1195
dev_deactivate+0xf8/0x1c0 net/sched/sch_generic.c:1233
qdisc_graft+0xd25/0x1120 net/sched/sch_api.c:1051
tc_modify_qdisc+0xbab/0x1a00 net/sched/sch_api.c:1670
rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5454
netlink_rcv_skb+0x15a/0x410 net/netlink/af_netlink.c:2469
netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329
netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918
sock_sendmsg_nosec net/socket.c:652 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:672
____sys_sendmsg+0x6bf/0x7e0 net/socket.c:2362
___sys_sendmsg+0x100/0x170 net/socket.c:2416
__sys_sendmsg+0xec/0x1b0 net/socket.c:2449
do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
Fixes: 77e62da6e60c ("sch_choke: drop all packets in queue during reset")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-04-27 11:35:27 -07:00
..
2020-03-27 09:29:56 +00:00
2020-02-24 13:02:53 -08:00
2020-02-17 14:30:54 -08:00
2020-02-04 03:05:26 +00:00
2020-01-09 18:41:40 -08:00
2020-03-12 22:34:48 -07:00
2020-03-25 22:16:08 +01:00
2020-03-28 18:13:18 +01:00
2020-04-03 13:12:26 -07:00
2020-03-20 08:52:20 -07:00
2020-03-11 22:55:25 -07:00
2020-03-30 12:42:41 +02:00
2020-04-25 20:49:32 -07:00
2020-02-29 15:53:35 -08:00
2020-03-23 21:57:44 -07:00
2020-03-29 12:40:41 +01:00
2020-04-22 19:22:59 -07:00
2020-01-27 11:09:31 +01:00
2020-03-29 22:32:37 -07:00
2020-04-07 18:34:18 -07:00
2020-03-03 13:28:48 -08:00
2020-04-22 19:57:39 -07:00
2020-04-22 12:32:11 -07:00
2020-03-16 17:14:02 -07:00
2020-04-08 14:30:46 -07:00
2020-02-26 20:38:13 -08:00
2020-04-24 11:31:20 +02:00
2020-03-29 22:30:57 -07:00
2020-04-25 20:38:54 -07:00
2020-01-09 18:36:22 -08:00
2020-04-21 11:50:31 -07:00
2020-04-22 19:55:01 -07:00
2020-03-25 18:58:11 -07:00
2020-04-18 13:09:46 -07:00
2020-03-12 22:34:48 -07:00
2020-04-20 10:53:54 -07:00
2020-03-15 00:25:25 -07:00
2020-01-03 12:25:50 -08:00
2020-04-09 10:08:31 -07:00
2020-04-15 12:33:29 -07:00
2020-01-26 10:40:21 +01:00
2020-04-14 16:26:47 -07:00
2020-04-27 11:35:27 -07:00
2020-04-22 19:27:40 -07:00
2020-03-12 22:34:48 -07:00
2020-04-17 12:40:38 -04:00
2020-02-26 20:58:33 -08:00
2020-04-18 13:24:20 -07:00
2020-04-27 11:22:38 -07:00
2020-02-28 12:12:53 -08:00
2020-04-27 10:18:01 -07:00
2020-04-14 12:28:48 +02:00
2020-04-27 11:20:30 -07:00
2020-04-15 13:07:18 +02:00
2020-03-30 10:59:20 -07:00
2020-03-10 09:12:49 -06:00
2020-03-25 12:24:33 -07:00
2020-01-24 13:44:07 +01:00
2020-03-30 12:18:49 -07:00