Eric Dumazet
7d63b67125
icmp: guard against too small mtu
syzbot was able to trigger a panic [1] in icmp_glue_bits(), or
more exactly in skb_copy_and_csum_bits()
There is no repro yet, but I think the issue is that syzbot
manages to lower device mtu to a small value, fooling __icmp_send()
__icmp_send() must make sure there is enough room for the
packet to include at least the headers.
We might in the future refactor skb_copy_and_csum_bits() and its
callers to no longer crash when something bad happens.
[1]
kernel BUG at net/core/skbuff.c:3343 !
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 15766 Comm: syz-executor.0 Not tainted 6.3.0-rc4-syzkaller-00039-gffe78bbd5121 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
RIP: 0010:skb_copy_and_csum_bits+0x798/0x860 net/core/skbuff.c:3343
Code: f0 c1 c8 08 41 89 c6 e9 73 ff ff ff e8 61 48 d4 f9 e9 41 fd ff ff 48 8b 7c 24 48 e8 52 48 d4 f9 e9 c3 fc ff ff e8 c8 27 84 f9 <0f> 0b 48 89 44 24 28 e8 3c 48 d4 f9 48 8b 44 24 28 e9 9d fb ff ff
RSP: 0018:ffffc90000007620 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 00000000000001e8 RCX: 0000000000000100
RDX: ffff8880276f6280 RSI: ffffffff87fdd138 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000
R10: 00000000000001e8 R11: 0000000000000001 R12: 000000000000003c
R13: 0000000000000000 R14: ffff888028244868 R15: 0000000000000b0e
FS: 00007fbc81f1c700(0000) GS:ffff88802ca00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2df43000 CR3: 00000000744db000 CR4: 0000000000150ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<IRQ>
icmp_glue_bits+0x7b/0x210 net/ipv4/icmp.c:353
__ip_append_data+0x1d1b/0x39f0 net/ipv4/ip_output.c:1161
ip_append_data net/ipv4/ip_output.c:1343 [inline]
ip_append_data+0x115/0x1a0 net/ipv4/ip_output.c:1322
icmp_push_reply+0xa8/0x440 net/ipv4/icmp.c:370
__icmp_send+0xb80/0x1430 net/ipv4/icmp.c:765
ipv4_send_dest_unreach net/ipv4/route.c:1239 [inline]
ipv4_link_failure+0x5a9/0x9e0 net/ipv4/route.c:1246
dst_link_failure include/net/dst.h:423 [inline]
arp_error_report+0xcb/0x1c0 net/ipv4/arp.c:296
neigh_invalidate+0x20d/0x560 net/core/neighbour.c:1079
neigh_timer_handler+0xc77/0xff0 net/core/neighbour.c:1166
call_timer_fn+0x1a0/0x580 kernel/time/timer.c:1700
expire_timers+0x29b/0x4b0 kernel/time/timer.c:1751
__run_timers kernel/time/timer.c:2022 [inline]
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Reported-by: syzbot+d373d60fddbdc915e666@syzkaller.appspotmail.com
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20230330174502.1915328-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-03-31 21:37:06 -07:00
..
2020-08-10 12:06:44 -07:00
2023-03-06 12:09:48 +01:00
2023-02-15 10:25:21 +00:00
2023-02-13 18:35:15 +08:00
2022-08-22 17:59:37 -07:00
2023-01-25 10:25:57 -08:00
2023-02-01 20:54:27 -08:00
2022-10-20 17:24:59 -07:00
2022-11-30 13:17:52 -08:00
2022-10-19 09:00:53 +02:00
2023-02-13 18:35:15 +08:00
2023-03-16 17:26:31 -07:00
2022-02-17 11:44:20 -08:00
2021-09-28 17:32:56 -07:00
2022-04-30 15:12:58 +01:00
2023-01-23 21:37:39 -08:00
2022-11-22 20:18:20 -08:00
2023-01-24 10:58:11 +01:00
2023-03-16 21:20:32 -07:00
2023-03-16 21:20:32 -07:00
2021-05-17 15:29:35 -07:00
2022-08-25 10:33:21 +02:00
2023-03-31 21:37:06 -07:00
2022-11-18 02:15:15 +01:00
2023-02-20 16:31:49 -08:00
2022-05-12 16:52:18 -07:00
2022-10-31 20:14:27 -07:00
2023-03-15 00:23:14 -07:00
2023-02-15 10:25:21 +00:00
2022-07-08 12:10:33 +01:00
2022-07-15 11:49:55 +01:00
2022-10-31 20:14:27 -07:00
2023-03-21 21:16:26 -07:00
2023-02-01 20:54:27 -08:00
2022-01-29 17:53:07 +00:00
2023-02-01 20:54:27 -08:00
2023-01-25 22:45:00 -08:00
2022-10-03 07:59:06 +01:00
2023-03-15 00:04:04 -07:00
2022-11-16 12:48:44 +00:00
2022-09-29 07:18:00 +02:00
2022-08-04 11:31:20 -07:00
2022-11-16 12:48:44 +00:00
2022-06-24 11:34:38 +01:00
2022-12-25 13:38:09 -08:00
2022-11-16 13:02:04 +00:00
2023-01-24 10:58:11 +01:00
2023-01-23 21:37:25 -08:00
2022-05-16 13:03:29 +02:00
2022-10-27 10:17:40 -07:00
2022-12-08 18:19:59 -08:00
2023-01-26 10:52:18 +01:00
2021-05-17 15:29:35 -07:00
2022-06-21 11:38:29 +02:00
2023-02-03 19:56:23 -08:00
2022-11-18 02:15:15 +01:00
2022-12-12 13:11:24 -08:00
2022-11-16 09:43:35 +00:00
2023-02-02 00:25:14 +01:00
2022-04-06 12:05:41 -07:00
2023-03-03 17:25:15 +01:00
2022-10-16 15:27:07 -07:00
2023-02-02 00:25:14 +01:00
2023-02-02 00:25:14 +01:00
2023-02-02 00:25:14 +01:00
2022-09-20 10:21:49 -07:00
2022-08-17 10:19:22 +01:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-12-13 15:47:48 -08:00
2023-02-02 21:14:50 -08:00
2022-04-06 12:05:41 -07:00
2022-08-29 12:47:15 +01:00
2023-02-27 11:59:29 -08:00
2022-04-06 12:05:41 -07:00
2022-10-03 12:38:34 +01:00
2023-03-09 23:12:00 -08:00
2022-12-20 03:13:45 +01:00
2022-04-28 13:02:01 -07:00
2022-07-20 10:14:50 +01:00
2022-04-06 12:05:41 -07:00
2022-08-17 10:19:22 +01:00
2023-01-19 09:26:16 -08:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2023-02-23 17:09:35 -08:00
2021-05-17 15:29:35 -07:00
2023-03-03 17:25:15 +01:00
2022-11-16 09:43:35 +00:00
2022-04-12 15:00:25 +02:00
2022-12-12 09:29:56 +00:00
2022-12-12 09:51:52 +00:00
2022-11-29 08:44:24 -08:00
2020-07-10 13:54:00 -07:00
2023-01-25 22:45:00 -08:00
2022-10-12 17:50:37 -07:00
2022-06-09 21:52:55 -07:00
2022-06-08 10:10:13 -07:00
2022-09-29 07:18:00 +02:00