
Eric DumazetandGreg Kroah-Hartman
f642700279
net: sched: validate stab values
[ Upstream commit e323d865b3 ]
iproute2 package is well behaved, but malicious user space can
provide illegal shift values and trigger UBSAN reports.
Add stab parameter to red_check_params() to validate user input.
syzbot reported:
UBSAN: shift-out-of-bounds in ./include/net/red.h:312:18
shift exponent 111 is too large for 64-bit type 'long unsigned int'
CPU: 1 PID: 14662 Comm: syz-executor.3 Not tainted 5.12.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:79 [inline]
dump_stack+0x141/0x1d7 lib/dump_stack.c:120
ubsan_epilogue+0xb/0x5a lib/ubsan.c:148
__ubsan_handle_shift_out_of_bounds.cold+0xb1/0x181 lib/ubsan.c:327
red_calc_qavg_from_idle_time include/net/red.h:312 [inline]
red_calc_qavg include/net/red.h:353 [inline]
choke_enqueue.cold+0x18/0x3dd net/sched/sch_choke.c:221
__dev_xmit_skb net/core/dev.c:3837 [inline]
__dev_queue_xmit+0x1943/0x2e00 net/core/dev.c:4150
neigh_hh_output include/net/neighbour.h:499 [inline]
neigh_output include/net/neighbour.h:508 [inline]
ip6_finish_output2+0x911/0x1700 net/ipv6/ip6_output.c:117
__ip6_finish_output net/ipv6/ip6_output.c:182 [inline]
__ip6_finish_output+0x4c1/0xe10 net/ipv6/ip6_output.c:161
ip6_finish_output+0x35/0x200 net/ipv6/ip6_output.c:192
NF_HOOK_COND include/linux/netfilter.h:290 [inline]
ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:215
dst_output include/net/dst.h:448 [inline]
NF_HOOK include/linux/netfilter.h:301 [inline]
NF_HOOK include/linux/netfilter.h:295 [inline]
ip6_xmit+0x127e/0x1eb0 net/ipv6/ip6_output.c:320
inet6_csk_xmit+0x358/0x630 net/ipv6/inet6_connection_sock.c:135
dccp_transmit_skb+0x973/0x12c0 net/dccp/output.c:138
dccp_send_reset+0x21b/0x2b0 net/dccp/output.c:535
dccp_finish_passive_close net/dccp/proto.c:123 [inline]
dccp_finish_passive_close+0xed/0x140 net/dccp/proto.c:118
dccp_terminate_connection net/dccp/proto.c:958 [inline]
dccp_close+0xb3c/0xe60 net/dccp/proto.c:1028
inet_release+0x12e/0x280 net/ipv4/af_inet.c:431
inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:478
__sock_release+0xcd/0x280 net/socket.c:599
sock_close+0x18/0x20 net/socket.c:1258
__fput+0x288/0x920 fs/file_table.c:280
task_work_run+0xdd/0x1a0 kernel/task_work.c:140
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
Fixes: 8afa10cbe2 ("net_sched: red: Avoid illegal values")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-30 14:31:57 +02:00
..
2020-07-15 20:34:11 -07:00
2021-03-07 12:34:10 +01:00
2020-09-29 14:02:53 -07:00
2020-05-19 12:50:14 -07:00
2020-12-08 20:42:11 +01:00
2020-10-12 10:06:39 +02:00
2020-02-27 12:06:20 -08:00
2020-09-20 14:15:12 -07:00
2020-10-15 12:43:21 -07:00
2020-02-28 14:51:30 +01:00
2021-03-04 11:38:47 +01:00
2020-08-18 15:58:53 -07:00
2020-08-20 18:21:28 +01:00
2020-02-28 12:12:53 -08:00
2020-07-21 18:30:47 -07:00
2020-05-01 12:15:37 -07:00
2020-12-08 11:26:08 -08:00
2020-09-25 13:58:01 -07:00
2020-06-20 17:30:59 -07:00
2020-10-30 10:06:09 +01:00
2020-02-29 14:39:08 +01:00
2020-08-20 15:45:15 -04:00
2020-07-15 07:45:24 -07:00
2020-03-27 19:40:38 -07:00
2020-07-19 18:16:40 -07:00
2020-10-09 12:06:53 -07:00
2020-02-29 21:52:20 -08:00
2020-10-05 05:56:48 -07:00
2020-05-08 21:33:33 -07:00
2020-08-31 12:33:34 -07:00
2020-05-05 13:23:29 -07:00
2020-02-19 13:52:32 +01:00
2020-04-20 07:34:16 +02:00
2020-07-28 17:42:31 -07:00
2020-07-24 15:23:31 -07:00
2020-08-05 20:13:21 -07:00
2020-09-14 14:54:56 -07:00
2020-07-31 09:24:24 +02:00
2020-07-31 09:24:24 +02:00
2020-10-05 18:40:01 -07:00
2020-06-22 21:12:44 -07:00
2021-03-04 11:38:46 +01:00
2020-07-31 09:27:00 +02:00
2020-05-11 13:18:54 -07:00
2020-03-30 13:45:04 -07:00
2020-05-09 00:48:20 +02:00
2021-01-27 11:55:25 +01:00
2020-12-01 17:16:54 -08:00
2020-11-23 16:32:33 -08:00
2020-08-26 07:33:19 -07:00
2020-06-20 17:47:53 -07:00
2020-07-15 20:34:11 -07:00
2020-05-18 17:35:02 -07:00
2020-05-26 16:06:07 -07:00
2020-11-13 16:58:10 -08:00
2020-08-31 23:06:51 +02:00
2020-10-05 18:40:01 -07:00
2020-11-19 10:49:50 -08:00
2020-08-31 12:26:39 -07:00
2020-11-19 10:49:50 -08:00
2020-02-05 14:28:09 +01:00
2020-06-20 17:22:22 -07:00
2020-03-29 22:30:57 -07:00
2020-10-30 10:06:09 +01:00
2020-03-26 20:17:36 -07:00
2020-03-02 11:16:27 -08:00
2020-02-29 21:52:20 -08:00
2020-02-28 12:08:37 -08:00
2020-05-29 21:20:20 -07:00
2020-09-24 20:17:01 -07:00
2020-08-24 06:40:07 -07:00
2020-11-13 14:24:39 -08:00
2020-09-30 11:50:35 -07:00
2020-10-09 20:22:32 -07:00
2021-03-30 14:31:57 +02:00
2020-02-20 10:09:25 -08:00
2020-03-04 13:25:55 -08:00
2020-07-16 16:48:34 -07:00
2020-10-09 08:08:08 -07:00
2021-03-30 14:31:57 +02:00
2020-07-31 09:24:23 +02:00
2020-08-24 14:35:00 -07:00
2020-03-23 21:57:44 -07:00
2020-06-23 20:27:09 -07:00
2021-02-10 09:29:23 +01:00
2020-07-13 11:03:44 -07:00
2020-06-04 15:39:32 -07:00
2020-09-28 15:19:03 -07:00
2020-02-29 21:52:19 -08:00
2021-01-27 11:55:23 +01:00
2021-02-17 11:02:29 +01:00
2021-03-04 11:37:33 +01:00
2020-11-25 17:31:06 -08:00
2020-06-23 20:10:15 -07:00
2020-06-18 20:46:23 -07:00
2020-09-28 12:50:12 -07:00
2021-02-10 09:29:23 +01:00
2020-09-14 16:49:39 -07:00
2020-07-15 20:34:02 -07:00
2020-08-31 21:15:04 +02:00
2021-01-17 14:17:05 +01:00
2020-12-09 16:27:42 +01:00
2020-10-05 18:40:01 -07:00
2021-01-17 14:17:05 +01:00