syzbot


general protection fault in ip6_rcv_core

Status: fixed on 2023/02/24 13:50
Subsystems: net
[Documentation on labels]
Fix commit: 0339d25a2807 ipv6: fix NULL deref in ip6_rcv_core()
First crash: 912d, last: 686d
Cause bisection: introduced by (bisect log) :
commit 4daf841a2ef3b2e987894c8107d309ce2b67c202
Author: Menglong Dong <imagedong@tencent.com>
Date: Wed Apr 13 08:15:59 2022 +0000

  net: ipv6: add skb drop reasons to ip6_rcv_core()

Crash: general protection fault in ip6_rcv_core (log)
Repro: C syz .config
  

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc00000000cd: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000668-0x000000000000066f]
CPU: 1 PID: 3597 Comm: kworker/1:4 Not tainted 5.18.0-rc1-syzkaller-00450-g9386ebccfc59 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: ipv6_addrconf addrconf_dad_work
RIP: 0010:ip6_rcv_core+0x12e8/0x1dd0 net/ipv6/ip6_input.c:169
Code: c1 ea 03 80 3c 02 00 0f 85 39 09 00 00 4c 89 f2 49 8b 85 b0 02 00 00 48 c1 ea 03 65 48 ff 40 68 48 b8 00 00 00 00 00 fc ff df <0f> b6 14 02 4c 89 f0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 f6
RSP: 0018:ffffc900001e0c58 EFLAGS: 00010203
RAX: dffffc0000000000 RBX: 0000000000000001 RCX: 0000000000000100
RDX: 00000000000000cd RSI: 0000000000000101 RDI: 0000000000000000
RBP: ffff88801987d3c0 R08: 0000000000000001 R09: ffff88801987d49f
R10: ffffffff87fa0cee R11: 0000000000000000 R12: 0000000000000000
R13: ffff88801e888000 R14: 000000000000066c R15: 0000000000000001
FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f09eeb8cc68 CR3: 000000000ba8e000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 ipv6_rcv+0x75/0x3b0 net/ipv6/ip6_input.c:303
 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5408
 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5522
 process_backlog+0x3a0/0x7c0 net/core/dev.c:5850
 __napi_poll+0xb3/0x6e0 net/core/dev.c:6416
 napi_poll net/core/dev.c:6483 [inline]
 net_rx_action+0x8ec/0xc60 net/core/dev.c:6570
 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558
 do_softirq.part.0+0xde/0x130 kernel/softirq.c:459
 </IRQ>
 <TASK>
 do_softirq kernel/softirq.c:451 [inline]
 __local_bh_enable_ip+0x102/0x120 kernel/softirq.c:383
 local_bh_enable include/linux/bottom_half.h:33 [inline]
 rcu_read_unlock_bh include/linux/rcupdate.h:764 [inline]
 ip6_finish_output2+0x5bc/0x1500 net/ipv6/ip6_output.c:127
 __ip6_finish_output net/ipv6/ip6_output.c:191 [inline]
 __ip6_finish_output+0x61e/0xe90 net/ipv6/ip6_output.c:170
 ip6_finish_output+0x32/0x280 net/ipv6/ip6_output.c:201
 NF_HOOK_COND include/linux/netfilter.h:296 [inline]
 ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:224
 dst_output include/net/dst.h:451 [inline]
 NF_HOOK include/linux/netfilter.h:307 [inline]
 ndisc_send_skb+0xa92/0x17f0 net/ipv6/ndisc.c:507
 ndisc_send_ns+0xa6/0x120 net/ipv6/ndisc.c:665
 addrconf_dad_work+0xc3f/0x1340 net/ipv6/addrconf.c:4173
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:ip6_rcv_core+0x12e8/0x1dd0 net/ipv6/ip6_input.c:169
Code: c1 ea 03 80 3c 02 00 0f 85 39 09 00 00 4c 89 f2 49 8b 85 b0 02 00 00 48 c1 ea 03 65 48 ff 40 68 48 b8 00 00 00 00 00 fc ff df <0f> b6 14 02 4c 89 f0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 f6
RSP: 0018:ffffc900001e0c58 EFLAGS: 00010203
RAX: dffffc0000000000 RBX: 0000000000000001 RCX: 0000000000000100
RDX: 00000000000000cd RSI: 0000000000000101 RDI: 0000000000000000
RBP: ffff88801987d3c0 R08: 0000000000000001 R09: ffff88801987d49f
R10: ffffffff87fa0cee R11: 0000000000000000 R12: 0000000000000000
R13: ffff88801e888000 R14: 000000000000066c R15: 0000000000000001
FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f09eeb8cc68 CR3: 000000000ba8e000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	c1 ea 03             	shr    $0x3,%edx
   3:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   7:	0f 85 39 09 00 00    	jne    0x946
   d:	4c 89 f2             	mov    %r14,%rdx
  10:	49 8b 85 b0 02 00 00 	mov    0x2b0(%r13),%rax
  17:	48 c1 ea 03          	shr    $0x3,%rdx
  1b:	65 48 ff 40 68       	incq   %gs:0x68(%rax)
  20:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  27:	fc ff df
* 2a:	0f b6 14 02          	movzbl (%rdx,%rax,1),%edx <-- trapping instruction
  2e:	4c 89 f0             	mov    %r14,%rax
  31:	83 e0 07             	and    $0x7,%eax
  34:	83 c0 03             	add    $0x3,%eax
  37:	38 d0                	cmp    %dl,%al
  39:	7c 08                	jl     0x43
  3b:	84 d2                	test   %dl,%dl
  3d:	0f                   	.byte 0xf
  3e:	85 f6                	test   %esi,%esi

Crashes (275):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/04/14 03:18 net-next-old 9386ebccfc59 b17b2923 .config console log report syz C ci-upstream-net-kasan-gce general protection fault in ip6_rcv_core
2022/04/15 23:11 net-next-old edf45f007a31 8bcc32a6 .config console log report info ci-upstream-net-kasan-gce general protection fault in ip6_rcv_core
2022/04/15 22:19 net-next-old edf45f007a31 8bcc32a6 .config console log report info ci-upstream-net-kasan-gce general protection fault in ip6_rcv_core
2022/04/13 18:06 net-next-old 9386ebccfc59 b17b2923 .config console log report info ci-upstream-net-kasan-gce general protection fault in ip6_rcv_core
2022/04/19 07:27 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/19 06:27 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/19 04:55 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/19 03:06 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/19 01:33 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 22:33 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 20:54 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 18:12 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 15:59 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 14:57 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 13:11 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 10:17 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 09:12 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 08:02 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 06:30 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 04:42 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 03:56 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/18 01:33 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 22:47 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 21:15 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 20:07 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 19:07 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 17:29 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 15:58 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 14:53 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 12:53 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 11:44 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 10:36 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 07:23 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 07:13 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 05:59 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 04:41 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 02:41 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/17 01:22 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 23:42 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 21:00 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 19:14 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 17:56 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 17:56 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 16:49 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 15:45 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 14:20 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 10:32 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 08:35 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 05:18 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/04/16 01:56 linux-next 40354149f4d7 8bcc32a6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in ip6_rcv_core
2022/11/26 09:59 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6d464646530f 74a66371 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 BUG: unable to handle kernel paging request in ip6_rcv_core
* Struck through repros no longer work on HEAD.