Eric Dumazet
75475bb51e
ipv6: fix potential NULL deref in fib6_add()
If fib6_find_prefix() returns NULL, we should silently fallback
using fib6_null_entry regardless of RT6_DEBUG value.
syzbot reported:
WARNING: CPU: 0 PID: 5477 at net/ipv6/ip6_fib.c:1516 fib6_add+0x310d/0x3fa0 net/ipv6/ip6_fib.c:1516
Modules linked in:
CPU: 0 PID: 5477 Comm: syz-executor.0 Not tainted 6.7.0-rc2-syzkaller-00029-g9b6de136b5f0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
RIP: 0010:fib6_add+0x310d/0x3fa0 net/ipv6/ip6_fib.c:1516
Code: 00 48 8b 54 24 68 e8 42 22 00 00 48 85 c0 74 14 49 89 c6 e8 d5 d3 c2 f7 eb 5d e8 ce d3 c2 f7 e9 ca 00 00 00 e8 c4 d3 c2 f7 90 <0f> 0b 90 48 b8 00 00 00 00 00 fc ff df 48 8b 4c 24 38 80 3c 01 00
RSP: 0018:ffffc90005067740 EFLAGS: 00010293
RAX: ffffffff89cba5bc RBX: ffffc90005067ab0 RCX: ffff88801a2e9dc0
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc90005067980 R08: ffffffff89cbca85 R09: 1ffff110040d4b85
R10: dffffc0000000000 R11: ffffed10040d4b86 R12: 00000000ffffffff
R13: 1ffff110051c3904 R14: ffff8880206a5c00 R15: ffff888028e1c820
FS: 00007f763783c6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f763783bff8 CR3: 000000007f74d000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__ip6_ins_rt net/ipv6/route.c:1303 [inline]
ip6_route_add+0x88/0x120 net/ipv6/route.c:3847
ipv6_route_ioctl+0x525/0x7b0 net/ipv6/route.c:4467
inet6_ioctl+0x21a/0x270 net/ipv6/af_inet6.c:575
sock_do_ioctl+0x152/0x460 net/socket.c:1220
sock_ioctl+0x615/0x8c0 net/socket.c:1339
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82
Fixes: 7bbfe00e02 ("ipv6: fix general protection fault in fib6_add()")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Wei Wang <weiwan@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20231129160630.3509216-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-11-30 23:20:14 -08:00
..
2023-08-02 12:28:16 -07:00
2023-11-08 13:52:32 +01:00
2022-06-09 21:52:55 -07:00
2023-10-25 18:23:06 -07:00
2022-11-07 12:26:15 +00:00
2023-10-30 14:36:57 -07:00
2023-10-27 18:04:29 +08:00
2023-07-28 11:01:56 +01:00
2021-03-04 15:26:57 -08:00
2023-09-15 10:33:48 +01:00
2023-10-06 07:31:14 +02:00
2023-10-25 10:38:07 +01:00
2023-05-24 08:43:39 +01:00
2023-08-08 15:36:47 -07:00
2022-02-08 20:41:34 -08:00
2023-10-06 08:31:53 +02:00
2023-10-01 19:09:54 +01:00
2023-07-31 13:53:10 -07:00
2023-10-26 16:24:09 -07:00
2022-08-29 12:47:15 +01:00
2023-11-30 23:20:14 -08:00
2023-09-15 10:33:48 +01:00
2023-07-19 12:25:58 +01:00
2021-02-23 11:29:52 -08:00
2023-09-01 08:11:51 +01:00
2023-06-10 00:11:41 -07:00
2023-10-25 18:04:29 -07:00
2023-03-15 00:04:04 -07:00
2023-10-23 08:48:57 +01:00
2023-10-06 08:31:53 +02:00
2023-08-30 09:44:09 +01:00
2022-09-29 07:18:00 +02:00
2023-09-19 18:21:44 +02:00
2023-08-16 10:03:08 +01:00
2023-10-27 10:35:44 +01:00
2021-04-27 14:02:06 -07:00
2023-10-20 12:01:00 +01:00
2022-09-29 07:18:01 +02:00
2023-10-20 12:01:00 +01:00
2023-10-06 08:31:53 +02:00
2022-11-18 02:15:22 +01:00
2023-10-11 15:03:40 -07:00
2023-10-20 12:01:00 +01:00
2023-10-20 12:01:00 +01:00
2023-08-15 15:26:18 -07:00
2023-09-19 18:21:44 +02:00
2023-07-12 17:12:29 -07:00
2023-06-19 11:32:58 -07:00
2022-06-28 21:23:30 -07:00
2023-05-17 09:05:47 +01:00
2023-08-15 18:51:47 -07:00
2022-09-08 18:38:30 +02:00
2023-04-28 09:48:14 +01:00
2023-11-02 12:56:03 +01:00
2023-08-15 15:26:18 -07:00
2023-10-27 10:35:46 +01:00
2023-10-27 10:35:46 +01:00
2023-05-31 09:50:17 +01:00
2022-10-12 17:50:37 -07:00
2023-07-29 17:10:27 +01:00
2023-10-11 15:03:40 -07:00
2023-09-14 16:16:36 +02:00
2023-10-23 07:10:39 +02:00
2023-10-25 18:04:29 -07:00
2023-10-17 18:21:13 -07:00
2022-09-29 07:18:00 +02:00