syzbot


BUG: unable to handle kernel paging request in dev_fetch_sw_netstats

Status: fixed on 2022/03/08 16:11
Subsystems: net
[Documentation on labels]
Fix commit: 158b515f703e tun: avoid double free in tun_free_netdev
First crash: 1061d, last: 1061d

Sample crash report:
BUG: unable to handle page fault for address: ffffe8ffff4fc8e0
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 10c3f067 P4D 10c3f067 PUD 127fa067 PMD 45846067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 32237 Comm: syz-executor.0 Not tainted 5.16.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:dev_fetch_sw_netstats+0x95/0x290 net/core/dev.c:10724
Code: 00 0f 85 f7 01 00 00 4a 8b 04 fd a0 38 56 8b 4c 01 f0 48 89 c2 49 89 c7 48 c1 ea 03 80 3c 2a 00 0f 85 cb 01 00 00 49 8d 7f 08 <49> 8b 37 48 89 fa 48 c1 ea 03 80 3c 2a 00 0f 85 9f 01 00 00 49 8d
RSP: 0018:ffffc9000315f898 EFLAGS: 00010246
RAX: ffffe8ffff4fc8e0 RBX: ffff888047b7a104 RCX: 0000000000000000
RDX: 1ffffd1fffe9f91c RSI: ffffffff8729a2cc RDI: ffffe8ffff4fc8e8
RBP: dffffc0000000000 R08: 0000000000000000 R09: ffff888047b7a1bc
R10: ffffffff8729a3f4 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000007 R14: 0000607f458fc8e0 R15: ffffe8ffff4fc8e0
FS:  00007fa6dda5e700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffe8ffff4fc8e0 CR3: 000000001868a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
Call Trace:
 <TASK>
 dev_get_stats+0xa5/0x2b0 net/core/dev.c:10691
 rtnl_fill_stats+0x48/0xa90 net/core/rtnetlink.c:1202
 rtnl_fill_ifinfo+0x12af/0x4270 net/core/rtnetlink.c:1774
 rtmsg_ifinfo_build_skb+0xcd/0x1a0 net/core/rtnetlink.c:3812
 unregister_netdevice_many+0x9e2/0x1790 net/core/dev.c:11084
 unregister_netdevice_queue+0x2dd/0x3c0 net/core/dev.c:11014
 register_netdevice+0x10de/0x1500 net/core/dev.c:10372
 __tun_chr_ioctl.isra.0+0x2bf6/0x4230 drivers/net/tun.c:2751
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fa6df12ae99
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa6dda5e168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fa6df23e100 RCX: 00007fa6df12ae99
RDX: 00000000200000c0 RSI: 00000000400454ca RDI: 0000000000000006
RBP: 00007fa6df184ff1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc4a3823cf R14: 00007fa6dda5e300 R15: 0000000000022000
 </TASK>
Modules linked in:
CR2: ffffe8ffff4fc8e0
---[ end trace 2004959c916225c4 ]---
RIP: 0010:dev_fetch_sw_netstats+0x95/0x290 net/core/dev.c:10724
Code: 00 0f 85 f7 01 00 00 4a 8b 04 fd a0 38 56 8b 4c 01 f0 48 89 c2 49 89 c7 48 c1 ea 03 80 3c 2a 00 0f 85 cb 01 00 00 49 8d 7f 08 <49> 8b 37 48 89 fa 48 c1 ea 03 80 3c 2a 00 0f 85 9f 01 00 00 49 8d
RSP: 0018:ffffc9000315f898 EFLAGS: 00010246
RAX: ffffe8ffff4fc8e0 RBX: ffff888047b7a104 RCX: 0000000000000000
RDX: 1ffffd1fffe9f91c RSI: ffffffff8729a2cc RDI: ffffe8ffff4fc8e8
RBP: dffffc0000000000 R08: 0000000000000000 R09: ffff888047b7a1bc
R10: ffffffff8729a3f4 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000007 R14: 0000607f458fc8e0 R15: ffffe8ffff4fc8e0
FS:  00007fa6dda5e700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffe8ffff4fc8e0 CR3: 000000001868a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	0f 85 f7 01 00 00    	jne    0x1fd
   6:	4a 8b 04 fd a0 38 56 	mov    -0x74a9c760(,%r15,8),%rax
   d:	8b
   e:	4c 01 f0             	add    %r14,%rax
  11:	48 89 c2             	mov    %rax,%rdx
  14:	49 89 c7             	mov    %rax,%r15
  17:	48 c1 ea 03          	shr    $0x3,%rdx
  1b:	80 3c 2a 00          	cmpb   $0x0,(%rdx,%rbp,1)
  1f:	0f 85 cb 01 00 00    	jne    0x1f0
  25:	49 8d 7f 08          	lea    0x8(%r15),%rdi
* 29:	49 8b 37             	mov    (%r15),%rsi <-- trapping instruction
  2c:	48 89 fa             	mov    %rdi,%rdx
  2f:	48 c1 ea 03          	shr    $0x3,%rdx
  33:	80 3c 2a 00          	cmpb   $0x0,(%rdx,%rbp,1)
  37:	0f 85 9f 01 00 00    	jne    0x1dc
  3d:	49                   	rex.WB
  3e:	8d                   	.byte 0x8d

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/12/19 01:39 bpf 819d11507f66 44068e19 .config console log report info ci-upstream-bpf-kasan-gce BUG: unable to handle kernel paging request in dev_fetch_sw_netstats
* Struck through repros no longer work on HEAD.