syzbot


general protection fault in ethnl_phy_doit

Status: internal: reported C repro on 2024/09/10 13:53
Subsystems: net
[Documentation on labels]
Fix commit: fce1e9f86af1 net: ethtool: phy: Check the req_info.pdn field for GET commands
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-snapshot-upstream-root ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce], missing on: [ci-qemu-native-arm64-kvm ci-qemu2-riscv64 ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci2-upstream-usb]
First crash: 10d, last: 9d18h
Cause bisection: introduced by (bisect log) :
commit 17194be4c8e1e82d8b484e58cdcb495c0714d1fd
Author: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: Wed Aug 21 15:10:01 2024 +0000

  net: ethtool: Introduce a command to list PHYs on an interface

Crash: BUG: unable to handle kernel NULL pointer dereference in ethnl_phy_doit (log)
Repro: C syz .config
  
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/09/10 16:40 29m edumazet@google.com patch net-next OK log

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
CPU: 0 UID: 0 PID: 5231 Comm: syz-executor425 Not tainted 6.11.0-rc6-syzkaller-01235-ga9b1fab3b69f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:ethnl_phy_doit+0x2f0/0x870 net/ethtool/phy.c:167
Code: 00 00 fc ff df 80 3c 08 00 74 05 e8 5a 91 2b f8 48 8b 5c 24 78 48 83 c3 18 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 48 89 df e8 32 91 2b f8 4c 8b 2b 4d 85 ed 74 25
RSP: 0018:ffffc90002de7360 EFLAGS: 00010206
RAX: 0000000000000003 RBX: 0000000000000018 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffc90002de73d8
RBP: ffffc90002de7470 R08: ffffffff89cb85e4 R09: 1ffffffff1f9194c
R10: dffffc0000000000 R11: fffffbfff1f9194d R12: 0000000000000000
R13: 1ffff11004fce1bd R14: ffffc90002de7740 R15: ffffc90002de73c0
FS:  000055557b87c380(0000) GS:ffff8880b8800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000355e7018 CR3: 0000000024632000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 genl_family_rcv_msg_doit net/netlink/genetlink.c:1115 [inline]
 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
 genl_rcv_msg+0xb14/0xec0 net/netlink/genetlink.c:1210
 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2550
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
 netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1357
 netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1901
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg+0x221/0x270 net/socket.c:745
 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2597
 ___sys_sendmsg net/socket.c:2651 [inline]
 __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2680
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8a140b5219
Code: 48 83 c4 28 c3 e8 e7 18 00 00 0f 1f 80 00 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc043fab58 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007ffc043fad28 RCX: 00007f8a140b5219
RDX: 0000000000000000 RSI: 0000000020000300 RDI: 0000000000000003
RBP: 00007f8a14127610 R08: 0000000000000000 R09: 00007ffc043fad28
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc043fad18 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:ethnl_phy_doit+0x2f0/0x870 net/ethtool/phy.c:167
Code: 00 00 fc ff df 80 3c 08 00 74 05 e8 5a 91 2b f8 48 8b 5c 24 78 48 83 c3 18 48 89 d8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 48 89 df e8 32 91 2b f8 4c 8b 2b 4d 85 ed 74 25
RSP: 0018:ffffc90002de7360 EFLAGS: 00010206
RAX: 0000000000000003 RBX: 0000000000000018 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffc90002de73d8
RBP: ffffc90002de7470 R08: ffffffff89cb85e4 R09: 1ffffffff1f9194c
R10: dffffc0000000000 R11: fffffbfff1f9194d R12: 0000000000000000
R13: 1ffff11004fce1bd R14: ffffc90002de7740 R15: ffffc90002de73c0
FS:  000055557b87c380(0000) GS:ffff8880b8800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000355e7018 CR3: 0000000024632000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 4 bytes skipped:
   0:	df 80 3c 08 00 74    	filds  0x7400083c(%rax)
   6:	05 e8 5a 91 2b       	add    $0x2b915ae8,%eax
   b:	f8                   	clc
   c:	48 8b 5c 24 78       	mov    0x78(%rsp),%rbx
  11:	48 83 c3 18          	add    $0x18,%rbx
  15:	48 89 d8             	mov    %rbx,%rax
  18:	48 c1 e8 03          	shr    $0x3,%rax
  1c:	48 b9 00 00 00 00 00 	movabs $0xdffffc0000000000,%rcx
  23:	fc ff df
* 26:	80 3c 08 00          	cmpb   $0x0,(%rax,%rcx,1) <-- trapping instruction
  2a:	74 08                	je     0x34
  2c:	48 89 df             	mov    %rbx,%rdi
  2f:	e8 32 91 2b f8       	call   0xf82b9166
  34:	4c 8b 2b             	mov    (%rbx),%r13
  37:	4d 85 ed             	test   %r13,%r13
  3a:	74 25                	je     0x61

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/10 17:27 net-next a9b1fab3b69f 784df80e .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_phy_doit
2024/09/10 16:26 net-next a9b1fab3b69f 784df80e .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_phy_doit
2024/09/10 15:37 net-next a9b1fab3b69f 784df80e .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_phy_doit
2024/09/10 14:42 net-next a9b1fab3b69f 784df80e .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_phy_doit
2024/09/11 11:14 net-next f3b6129b7d25 9326a104 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_phy_doit
2024/09/10 13:52 net-next a9b1fab3b69f 784df80e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_phy_doit
* Struck through repros no longer work on HEAD.