Eric Dumazet
d836f5c69d
net: rtnetlink: validate IFLA_MTU attribute in rtnl_create_link()
rtnl_create_link() needs to apply dev->min_mtu and dev->max_mtu
checks that we apply in do_setlink()
Otherwise malicious users can crash the kernel, for example after
an integer overflow :
BUG: KASAN: use-after-free in memset include/linux/string.h:365 [inline]
BUG: KASAN: use-after-free in __alloc_skb+0x37b/0x5e0 net/core/skbuff.c:238
Write of size 32 at addr ffff88819f20b9c0 by task swapper/0/0
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.5.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x197/0x210 lib/dump_stack.c:118
print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374
__kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506
kasan_report+0x12/0x20 mm/kasan/common.c:639
check_memory_region_inline mm/kasan/generic.c:185 [inline]
check_memory_region+0x134/0x1a0 mm/kasan/generic.c:192
memset+0x24/0x40 mm/kasan/common.c:108
memset include/linux/string.h:365 [inline]
__alloc_skb+0x37b/0x5e0 net/core/skbuff.c:238
alloc_skb include/linux/skbuff.h:1049 [inline]
alloc_skb_with_frags+0x93/0x590 net/core/skbuff.c:5664
sock_alloc_send_pskb+0x7ad/0x920 net/core/sock.c:2242
sock_alloc_send_skb+0x32/0x40 net/core/sock.c:2259
mld_newpack+0x1d7/0x7f0 net/ipv6/mcast.c:1609
add_grhead.isra.0+0x299/0x370 net/ipv6/mcast.c:1713
add_grec+0x7db/0x10b0 net/ipv6/mcast.c:1844
mld_send_cr net/ipv6/mcast.c:1970 [inline]
mld_ifc_timer_expire+0x3d3/0x950 net/ipv6/mcast.c:2477
call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1404
expire_timers kernel/time/timer.c:1449 [inline]
__run_timers kernel/time/timer.c:1773 [inline]
__run_timers kernel/time/timer.c:1740 [inline]
run_timer_softirq+0x6c3/0x1790 kernel/time/timer.c:1786
__do_softirq+0x262/0x98c kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x19b/0x1e0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829
</IRQ>
RIP: 0010:native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:61
Code: 98 6b ea f9 eb 8a cc cc cc cc cc cc e9 07 00 00 00 0f 00 2d 44 1c 60 00 f4 c3 66 90 e9 07 00 00 00 0f 00 2d 34 1c 60 00 fb f4 <c3> cc 55 48 89 e5 41 57 41 56 41 55 41 54 53 e8 4e 5d 9a f9 e8 79
RSP: 0018:ffffffff89807ce8 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13
RAX: 1ffffffff13266ae RBX: ffffffff8987a1c0 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000006 RDI: ffffffff8987aa54
RBP: ffffffff89807d18 R08: ffffffff8987a1c0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000
R13: ffffffff8a799980 R14: 0000000000000000 R15: 0000000000000000
arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:690
default_idle_call+0x84/0xb0 kernel/sched/idle.c:94
cpuidle_idle_call kernel/sched/idle.c:154 [inline]
do_idle+0x3c8/0x6e0 kernel/sched/idle.c:269
cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:361
rest_init+0x23b/0x371 init/main.c:451
arch_call_rest_init+0xe/0x1b
start_kernel+0x904/0x943 init/main.c:784
x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:490
x86_64_start_kernel+0x77/0x7b arch/x86/kernel/head64.c:471
secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:242
The buggy address belongs to the page:
page:ffffea00067c82c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
raw: 057ffe0000000000 ffffea00067c82c8 ffffea00067c82c8 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88819f20b880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88819f20b900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88819f20b980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88819f20ba00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88819f20ba80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Fixes: 61e84623ac ("net: centralize net_device min/max MTU checking")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-23 11:14:21 +01:00
..
2020-01-02 15:34:27 +01:00
2019-11-27 22:28:37 +01:00
2019-11-27 08:15:00 -08:00
2019-11-14 16:03:35 +05:30
2019-10-02 12:19:53 -04:00
2019-12-05 11:43:31 -08:00
2019-10-31 14:19:45 -07:00
2019-11-22 19:56:20 +00:00
2019-11-03 10:47:42 +00:00
2019-12-03 09:29:50 -08:00
2019-11-12 11:43:29 -05:00
2019-12-11 13:22:54 +01:00
2019-11-27 10:17:28 -08:00
2019-11-18 10:05:38 +01:00
2020-01-09 20:08:15 +01:00
2019-10-07 23:59:02 +02:00
2019-10-31 16:54:00 +05:30
2019-12-10 07:18:21 -08:00
2019-11-13 11:33:53 +01:00
2019-11-07 13:10:08 +00:00
2019-10-16 10:39:00 +02:00
2019-12-12 17:59:43 +01:00
2019-12-05 11:43:31 -08:00
2019-11-09 16:46:56 +05:30
2019-12-27 23:03:43 +00:00
2019-12-07 16:56:00 -08:00
2019-11-16 14:45:31 +01:00
2019-10-15 12:06:23 +02:00
2019-10-18 17:05:42 -05:00
2019-12-04 13:32:45 +10:00
2019-12-25 20:47:19 -07:00
2019-11-14 12:31:00 +08:00
2019-10-14 10:55:14 +01:00
2019-10-21 19:20:30 +01:00
2019-11-23 09:56:02 -08:00
2019-12-28 09:44:56 -07:00
2019-12-04 19:44:14 -08:00
2019-12-04 19:44:12 -08:00
2019-11-21 09:06:47 -07:00
2019-12-12 09:26:55 -07:00
2019-11-13 12:50:38 -07:00
2020-01-15 21:43:09 -07:00
2019-11-15 23:44:48 +01:00
2019-11-24 17:04:11 -08:00
2019-12-17 08:58:02 -08:00
2019-12-16 10:59:29 -08:00
2019-10-23 20:42:52 -07:00
2019-11-14 13:15:11 -05:00
2019-11-15 23:45:24 +01:00
2019-12-04 19:44:12 -08:00
2020-01-04 20:23:39 -07:00
2019-11-12 08:18:04 -08:00
2019-11-12 08:18:04 -08:00
2019-11-11 13:59:35 +01:00
2019-09-24 15:54:10 -07:00
2019-12-01 14:00:59 -08:00
2019-10-11 09:26:05 -07:00
2019-10-29 10:01:16 +01:00
2019-10-29 10:01:14 +01:00
2019-11-04 21:57:51 +01:00
2019-10-18 19:47:49 +01:00
2019-11-07 07:00:26 +01:00
2019-11-26 10:26:26 +01:00
2019-12-12 17:59:43 +01:00
2019-11-26 09:43:34 -08:00
2019-11-29 11:48:39 +01:00
2019-09-25 17:51:40 -07:00
2019-09-23 11:21:04 -07:00
2019-11-17 09:02:49 +08:00
2019-11-15 13:49:04 -05:00
2019-11-21 14:28:32 +01:00
2019-12-09 12:19:16 +09:00
2019-10-07 15:11:38 -05:00
2019-11-25 11:53:26 -08:00
2019-12-12 14:49:57 +01:00
2019-10-09 19:33:43 -07:00
2019-10-24 09:18:09 +02:00
2019-11-21 18:14:35 +01:00
2019-11-28 11:16:43 -08:00
2019-11-20 20:31:38 +01:00
2019-12-11 16:03:20 +05:30
2019-11-11 16:07:13 +01:00
2019-12-03 11:20:37 +01:00
2019-10-22 12:54:44 -07:00
2019-11-10 12:40:14 +01:00
2019-12-08 12:42:19 +01:00
2019-11-07 07:02:40 +01:00
2019-10-17 16:23:25 +02:00
2019-12-05 12:27:16 -08:00
2019-11-12 08:18:04 -08:00
2019-10-17 16:44:36 +02:00
2019-12-02 14:46:22 -08:00
2019-12-09 10:36:44 -08:00
2019-09-25 09:55:59 -07:00
2019-12-02 14:46:22 -08:00
2019-11-06 12:34:36 -08:00
2019-12-11 12:22:38 -08:00
2019-11-20 09:40:10 +01:00
2019-11-27 11:06:20 -08:00
2019-12-04 19:44:13 -08:00
2019-11-14 07:43:53 -07:00
2019-12-01 12:59:06 -08:00
2019-11-23 19:56:45 -04:00
2019-10-29 15:04:34 +01:00
2019-11-06 23:18:31 +01:00
2019-11-06 13:02:17 +01:00
2019-12-01 12:59:08 -08:00
2019-10-02 06:36:50 -07:00
2019-11-21 20:10:44 -05:00
2019-12-11 08:39:07 +01:00
2019-11-05 14:03:11 -08:00
2019-11-05 14:03:11 -08:00
2019-11-08 08:46:49 -08:00
2020-01-08 12:52:33 -08:00
2019-10-24 14:53:49 -07:00
2019-10-24 14:53:48 -07:00
2019-10-24 14:53:49 -07:00
2019-11-12 12:25:49 +11:00
2019-12-12 18:58:24 +01:00
2019-10-04 12:31:46 -07:00
2019-11-11 16:10:54 +01:00
2019-12-03 12:20:25 -08:00
2019-09-25 17:51:39 -07:00
2019-11-04 19:59:30 +00:00
2019-11-11 08:40:18 +00:00
2019-10-15 13:34:25 +02:00
2019-10-21 08:51:59 -07:00
2019-11-12 17:11:25 +01:00
2019-11-07 15:44:14 +01:00
2019-10-22 14:42:34 -05:00
2019-11-11 09:02:56 +01:00
2019-11-16 10:20:02 +00:00
2019-11-16 10:18:52 +00:00
2019-12-22 10:41:48 -08:00
2019-10-21 09:16:46 -04:00
2019-12-17 20:59:59 -08:00
2019-12-04 19:44:14 -08:00
2019-11-21 07:33:24 +01:00
2019-12-30 12:01:56 -08:00
2019-11-12 08:18:04 -08:00
2019-09-28 08:14:15 -07:00
2019-09-25 17:51:40 -07:00
2019-09-24 15:54:11 -07:00
2019-12-09 10:36:44 -08:00
2019-10-21 19:20:28 +01:00
2019-11-03 17:38:36 +01:00
2019-11-03 17:38:55 +01:00
2019-12-25 17:08:33 -07:00
2019-11-26 13:35:25 -07:00
2019-11-19 09:52:12 -08:00
2019-11-14 11:36:53 +08:00
2019-10-18 12:13:35 +02:00
2019-10-15 20:40:06 -07:00
2019-11-01 13:08:19 +01:00
2019-10-09 12:46:10 +02:00
2019-11-05 08:45:46 +08:00
2019-10-17 21:31:55 +02:00
2019-12-01 12:59:08 -08:00
2019-12-01 12:59:07 -08:00
2020-01-04 13:55:08 -08:00
2019-11-15 18:34:00 -08:00
2019-09-28 14:05:38 -07:00
2019-11-07 15:45:00 +01:00
2019-09-29 10:33:41 -07:00
2019-10-17 16:31:52 -07:00
2019-10-04 18:11:08 -07:00
2019-12-06 10:28:09 -08:00
2019-09-25 17:51:40 -07:00
2019-11-06 08:28:58 -08:00
2020-01-13 18:19:02 -08:00
2019-11-23 19:56:44 -04:00
2020-01-13 18:19:02 -08:00
2019-12-20 21:47:04 -08:00
2019-11-14 11:36:53 +08:00
2019-12-01 12:59:05 -08:00
2019-11-07 15:11:48 +01:00
2019-10-04 11:10:56 -07:00
2019-10-23 17:23:44 +02:00
2020-01-15 01:36:06 -05:00
2019-11-14 19:06:47 -08:00
2020-01-23 11:14:21 +01:00
2019-10-17 12:20:48 +02:00
2019-11-06 08:55:24 -05:00
2019-11-06 08:55:23 -05:00
2019-10-09 12:06:19 -04:00
2019-11-06 08:55:23 -05:00
2019-12-04 19:44:12 -08:00
2019-11-27 02:48:27 +09:00
2019-11-04 10:56:40 -07:00
2019-11-22 02:21:08 +09:00
2019-11-27 10:53:50 -08:00
2019-10-08 13:55:26 -05:00
2019-12-26 15:17:26 -08:00
2019-11-04 11:21:25 -08:00
2019-11-21 07:49:29 -06:00
2019-10-14 15:04:00 -07:00
2019-11-06 08:28:58 -08:00
2019-12-01 12:59:04 -08:00
2019-09-24 15:54:08 -07:00
2019-11-06 13:02:43 +01:00
2019-11-13 19:09:47 +08:00
2019-11-20 16:30:10 +00:00
2019-10-15 16:39:11 -05:00
2019-10-14 10:22:26 -05:00
2019-12-03 13:58:22 -08:00
2019-11-25 14:28:04 -08:00
2019-11-16 20:02:47 -08:00
2019-10-09 12:46:10 +02:00
2019-11-26 15:04:47 -08:00
2019-12-09 10:36:44 -08:00
2019-12-20 21:48:06 -08:00
2019-11-23 16:13:39 -08:00
2019-11-15 23:49:22 +01:00
2019-11-15 23:49:22 +01:00
2019-12-07 13:21:01 -08:00
2019-11-05 18:33:13 +01:00
2019-11-13 11:41:50 +01:00
2019-11-11 10:27:15 +05:30
2019-11-29 12:04:50 +01:00
2019-10-29 14:45:54 -05:00
2019-11-13 11:41:50 +01:00
2019-12-30 20:19:27 -08:00
2019-12-06 10:47:28 +01:00
2019-12-04 19:44:11 -08:00
2019-11-05 23:18:10 +01:00
2019-10-14 10:55:14 +01:00
2019-10-21 16:50:03 +02:00
2019-10-18 18:24:50 +01:00
2019-12-06 10:28:09 -08:00
2019-11-11 11:06:27 +01:00
2019-11-06 10:52:10 +01:00
2019-11-01 22:26:34 -04:00
2019-12-04 19:44:13 -08:00
2019-10-30 08:32:07 -07:00
2019-12-13 21:40:49 -08:00
2019-11-26 16:02:40 -08:00
2019-10-05 10:46:05 -07:00
2019-10-05 10:46:05 -07:00
2019-09-25 17:42:29 +02:00
2019-11-25 09:15:32 +01:00
2019-12-05 11:43:31 -08:00
2019-12-05 11:43:31 -08:00
2019-10-29 10:47:14 +00:00
2019-10-19 22:55:46 +02:00
2019-11-14 13:07:48 +08:00
2019-10-09 12:46:10 +02:00
2019-11-13 12:50:40 -07:00
2019-12-25 10:41:20 +01:00
2019-10-10 14:55:24 -07:00
2019-11-30 14:35:43 -08:00
2019-11-04 07:11:31 -07:00
2019-11-14 13:15:12 -05:00
2019-10-09 12:46:10 +02:00
2019-11-20 22:29:40 -08:00
2019-09-24 15:54:11 -07:00
2019-12-04 17:11:25 -08:00
2020-01-15 23:26:13 +01:00
2019-12-01 06:29:17 -08:00
2019-12-03 07:04:30 -07:00
2019-11-14 13:15:11 -05:00
2019-10-09 12:46:10 +02:00
2019-11-13 12:15:34 -08:00
2019-11-04 11:21:25 -08:00
2019-12-01 06:29:18 -08:00
2019-12-01 12:59:07 -08:00
2020-01-06 13:33:14 -08:00
2019-10-10 14:35:32 +02:00
2020-01-02 16:15:33 -08:00
2019-12-04 19:44:11 -08:00
2019-11-13 00:33:21 +11:00
2019-10-25 19:25:37 -07:00
2019-11-07 07:00:26 +01:00
2019-12-04 19:44:14 -08:00
2019-11-26 15:42:43 -08:00
2019-11-15 14:38:29 +01:00
2019-12-06 21:05:14 -08:00
2020-01-15 13:39:59 -08:00
2019-10-07 15:24:36 +02:00
2019-12-17 11:46:43 +02:00
2019-11-22 19:41:08 -05:00
2019-11-14 13:15:12 -05:00
2019-11-22 19:41:08 -05:00
2019-12-01 14:00:59 -08:00
2019-11-07 20:03:08 -08:00
2019-11-02 12:39:12 -07:00
2019-10-31 15:12:34 +00:00
2019-11-14 18:12:18 -08:00
2019-12-01 12:59:05 -08:00
2019-12-04 19:44:11 -08:00
2019-11-14 18:12:18 -08:00
2019-10-29 10:01:16 +01:00
2019-11-14 12:20:02 +08:00
2019-10-31 15:12:23 +00:00
2019-10-09 12:46:10 +02:00
2019-10-14 15:04:01 -07:00
2019-09-24 15:54:12 -07:00