Eric Dumazet
a8e409a117
net: sched: validate stab values
commit e323d865b3 upstream.
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-16 10:49:32 +09:00
..
2015-04-11 22:28:27 -04:00
2023-05-16 09:27:52 +09:00
2023-05-15 12:38:05 +09:00
2014-12-10 15:33:16 -05:00
2015-09-21 16:03:04 -07:00
2023-05-16 09:04:25 +09:00
2023-05-15 14:18:16 +09:00
2023-05-15 08:24:46 +09:00
2023-05-15 12:05:35 +09:00
2023-05-16 08:21:01 +09:00
2023-05-12 17:06:33 +09:00
2016-06-15 20:41:22 -07:00
2023-05-15 17:29:41 +09:00
2023-05-16 08:45:22 +09:00
2015-09-17 13:20:05 +02:00
2016-09-08 11:10:12 +01:00
2016-09-04 13:29:29 -07:00
2023-05-12 16:57:03 +09:00
2014-09-18 10:54:36 +02:00
2023-05-15 13:41:16 +09:00
2023-05-15 11:43:44 +09:00
2016-02-09 04:45:49 -05:00
2014-11-10 13:27:49 -05:00
2015-07-27 01:05:24 -07:00
2023-05-16 09:50:45 +09:00
2015-11-18 16:17:38 -05:00
2016-06-27 15:06:17 -04:00
2023-05-15 16:33:59 +09:00
2016-07-08 12:20:57 +02:00
2016-03-13 15:01:00 -04:00
2017-02-18 15:11:41 +01:00
2016-04-19 20:09:25 -04:00
2016-04-25 16:44:27 -04:00
2016-06-25 12:19:35 -04:00
2016-04-25 16:44:27 -04:00
2016-06-09 23:41:03 -07:00
2014-02-09 17:32:50 -08:00
2013-12-06 12:37:56 -05:00
2015-03-06 21:50:02 -05:00
2016-08-26 11:55:18 -07:00
2013-12-10 21:50:00 -05:00
2013-09-20 14:49:32 -04:00
2015-09-17 17:18:37 -07:00
2013-09-20 14:49:32 -04:00
2014-02-09 17:32:49 -08:00
2014-02-09 17:32:49 -08:00
2016-09-23 08:38:50 -04:00
2016-02-16 20:21:48 -05:00
2016-09-10 20:53:55 -07:00
2015-10-08 04:27:02 -07:00
2023-05-16 08:30:05 +09:00
2013-11-07 19:28:58 -05:00
2015-09-23 15:33:15 -07:00
2023-05-15 17:09:01 +09:00
2023-05-15 17:01:38 +09:00
2017-01-27 13:55:59 -08:00
2014-02-12 07:02:11 +01:00
2016-05-20 18:03:16 -04:00
2023-05-15 14:57:24 +09:00
2023-05-15 14:57:24 +09:00
2013-09-20 14:49:33 -04:00
2016-06-07 16:37:14 -07:00
2023-05-16 08:30:10 +09:00
2016-06-17 20:23:32 -07:00
2016-08-18 01:17:32 -04:00
2023-05-15 11:55:36 +09:00
2016-07-25 17:55:43 -07:00
2014-11-05 16:30:03 -05:00
2016-03-14 12:19:46 -04:00
2023-05-16 10:39:14 +09:00
2016-09-12 11:45:45 +02:00
2016-01-04 20:40:41 +01:00
2016-10-14 10:59:15 -04:00
2015-12-15 23:25:20 -05:00
2016-03-22 15:45:44 -04:00
2016-04-04 22:11:20 -04:00
2016-05-20 18:03:17 -04:00
2023-05-16 09:05:47 +09:00
2023-05-16 09:51:15 +09:00
2023-05-15 12:36:15 +09:00
2023-05-15 16:21:53 +09:00
2023-05-15 09:02:06 +09:00
2018-05-16 10:08:41 +02:00
2023-05-15 11:43:33 +09:00
2016-03-13 23:55:13 -04:00
2017-09-20 08:19:53 +02:00
2023-05-15 17:15:16 +09:00
2023-05-15 13:58:21 +09:00
2023-05-15 11:09:54 +09:00
2016-09-17 10:13:07 -04:00
2023-05-15 14:58:44 +09:00
2023-05-16 09:35:10 +09:00
2023-05-15 14:29:07 +09:00
2023-05-15 17:27:11 +09:00
2014-11-24 04:28:49 -05:00
2017-08-11 08:49:34 -07:00
2016-08-17 19:36:23 -04:00
2023-05-15 11:16:26 +09:00
2013-09-21 14:01:38 -04:00
2014-10-14 02:18:27 +02:00
2013-09-21 14:01:38 -04:00
2013-09-21 14:01:38 -04:00
2014-12-10 15:21:24 -05:00
2023-05-15 14:56:19 +09:00
2013-09-21 14:01:38 -04:00
2014-01-01 22:22:43 -05:00
2013-09-21 14:01:38 -04:00
2013-09-21 14:01:38 -04:00
2014-12-10 15:21:24 -05:00
2013-09-21 14:01:38 -04:00
2023-05-15 15:09:01 +09:00
2017-02-18 15:11:42 +01:00
2018-05-30 07:50:28 +02:00
2016-07-08 13:23:12 +02:00
2013-12-06 12:37:56 -05:00
2014-09-22 16:23:15 -04:00
2015-10-23 06:26:42 -07:00
2016-10-03 02:00:22 -04:00
2013-10-01 17:06:14 -04:00
2016-10-04 02:11:51 -04:00
2016-06-15 20:41:23 -07:00
2023-05-15 16:31:00 +09:00
2023-05-15 12:22:38 +09:00
2016-07-05 09:06:29 -07:00
2016-06-27 15:06:18 -04:00
2017-10-12 11:51:25 +02:00
2015-12-08 22:02:33 -05:00
2013-09-21 14:01:39 -04:00
2018-05-16 10:08:41 +02:00
2016-07-08 12:20:57 +02:00
2013-09-21 14:01:39 -04:00
2016-03-23 22:09:58 -04:00
2016-09-28 05:02:44 -04:00
2016-08-10 17:19:02 -07:00
2016-08-15 10:55:53 -07:00
2016-04-07 16:53:30 -04:00
2013-09-23 01:51:08 -04:00
2016-02-11 03:54:14 -05:00
2013-09-23 01:51:08 -04:00
2023-05-16 10:49:32 +09:00
2018-05-30 07:50:30 +02:00
2016-04-04 22:11:19 -04:00
2013-09-23 01:51:08 -04:00
2018-05-30 13:19:56 +02:00
2023-05-16 10:49:31 +09:00
2023-05-15 14:56:24 +09:00
2016-02-08 10:30:42 -05:00
2014-06-02 11:00:41 -07:00
2018-04-20 08:21:07 +02:00
2016-04-28 11:49:45 -04:00
2016-01-19 14:44:23 -05:00
2023-05-16 08:47:54 +09:00
2013-12-19 18:51:20 -05:00
2013-09-23 01:51:09 -04:00
2016-08-28 23:32:41 -04:00
2016-09-28 04:48:00 -04:00
2015-03-12 22:58:12 -04:00
2023-05-15 17:22:55 +09:00
2015-07-09 15:12:20 -07:00
2016-05-03 16:08:14 -04:00
2015-10-26 22:24:22 -07:00
2016-06-17 20:23:32 -07:00
2016-10-20 14:45:52 -04:00
2018-03-11 16:21:32 +01:00
2017-07-21 07:42:18 +02:00
2013-09-23 16:29:40 -04:00
2014-09-05 17:35:28 -07:00
2018-04-13 19:48:00 +02:00
2023-05-16 09:44:10 +09:00