syzbot


general protection fault in ethnl_set_plca_cfg

Status: fixed on 2023/06/08 14:41
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+8cf35743af243e5f417e@syzkaller.appspotmail.com
Fix commit: 28dbf774bc87 plca.c: fix obvious mistake in checking retval
First crash: 471d, last: 467d
Cause bisection: introduced by (bisect log) :
commit 8580e16c28f3f1a1bee87de115157161577334b4
Author: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
Date: Mon Jan 9 16:59:39 2023 +0000

  net/ethtool: add netlink interface for the PLCA RS

Crash: general protection fault in ethnl_set_plca_cfg (log)
Repro: C syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[PATCH net-next 1/1] ethtool/plca: fix potential NULL pointer access 3 (3) 2023/01/17 09:13
[syzbot] general protection fault in ethnl_set_plca_cfg 1 (2) 2023/01/16 09:33
[PATCH net-next] net/ethtool: fix general protection fault in ethnl_set_plca_cfg() 2 (2) 2023/01/16 07:10

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000173: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000b98-0x0000000000000b9f]
CPU: 1 PID: 5067 Comm: syz-executor355 Not tainted 6.2.0-rc2-syzkaller-00378-g60d86034b14e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:ethnl_set_plca_cfg+0x1c5/0x810 net/ethtool/plca.c:162
Code: 28 7a f9 4c 8b 7c 24 58 e8 d8 17 c6 ff 49 8d 87 98 0b 00 00 48 89 c2 48 89 44 24 08 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 7d 05 00 00 49 83 bf 98 0b 00 00 00 0f 84 b8 04
RSP: 0018:ffffc90003cbf470 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffffc90003cbf5d8 RCX: 0000000000000000
RDX: 0000000000000173 RSI: 0000000000000002 RDI: 0000000000000001
RBP: 1ffff92000797e95 R08: 0000000000000000 R09: ffffffff8e72e917
R10: fffffbfff1ce5d22 R11: 0000000000000000 R12: 00000000ffffffea
R13: ffff88801cc43980 R14: ffffc90003cbf618 R15: 0000000000000000
FS:  00005555563b5300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001ac0 CR3: 000000007d808000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 genl_family_rcv_msg_doit.isra.0+0x1e6/0x2d0 net/netlink/genetlink.c:968
 genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline]
 genl_rcv_msg+0x4ff/0x7e0 net/netlink/genetlink.c:1065
 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2564
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1076
 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
 netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1356
 netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1932
 sock_sendmsg_nosec net/socket.c:714 [inline]
 sock_sendmsg+0xd3/0x120 net/socket.c:734
 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2476
 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2530
 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2559
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fb1764e4ae9
Code: 28 c3 e8 5a 14 00 00 66 2e 0f 1f 84 00 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd5160add8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb1764e4ae9
RDX: 0000000000000000 RSI: 0000000020001ac0 RDI: 0000000000000003
RBP: 00007fb1764a84b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb1764a8540
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:ethnl_set_plca_cfg+0x1c5/0x810 net/ethtool/plca.c:162
Code: 28 7a f9 4c 8b 7c 24 58 e8 d8 17 c6 ff 49 8d 87 98 0b 00 00 48 89 c2 48 89 44 24 08 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 7d 05 00 00 49 83 bf 98 0b 00 00 00 0f 84 b8 04
RSP: 0018:ffffc90003cbf470 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffffc90003cbf5d8 RCX: 0000000000000000
RDX: 0000000000000173 RSI: 0000000000000002 RDI: 0000000000000001
RBP: 1ffff92000797e95 R08: 0000000000000000 R09: ffffffff8e72e917
R10: fffffbfff1ce5d22 R11: 0000000000000000 R12: 00000000ffffffea
R13: ffff88801cc43980 R14: ffffc90003cbf618 R15: 0000000000000000
FS:  00005555563b5300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001ac0 CR3: 000000007d808000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	28 7a f9             	sub    %bh,-0x7(%rdx)
   3:	4c 8b 7c 24 58       	mov    0x58(%rsp),%r15
   8:	e8 d8 17 c6 ff       	callq  0xffc617e5
   d:	49 8d 87 98 0b 00 00 	lea    0xb98(%r15),%rax
  14:	48 89 c2             	mov    %rax,%rdx
  17:	48 89 44 24 08       	mov    %rax,0x8(%rsp)
  1c:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  23:	fc ff df
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2e:	0f 85 7d 05 00 00    	jne    0x5b1
  34:	49 83 bf 98 0b 00 00 	cmpq   $0x0,0xb98(%r15)
  3b:	00
  3c:	0f                   	.byte 0xf
  3d:	84                   	.byte 0x84
  3e:	b8                   	.byte 0xb8
  3f:	04                   	.byte 0x4

Crashes (37):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/11 21:42 net-next-old 60d86034b14e 96166539 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/15 00:50 net-next-old e471d83e1fa0 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/14 21:02 net-next-old e471d83e1fa0 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/14 20:07 net-next-old e471d83e1fa0 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/14 19:56 net-next-old e471d83e1fa0 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/14 08:20 net-next-old 6e6eda44b939 529798b0 .config console log report info ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/14 04:48 net-next-old 6e6eda44b939 529798b0 .config console log report info ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/14 00:27 net-next-old 6e6eda44b939 529798b0 .config console log report info ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/13 22:41 net-next-old 6e6eda44b939 529798b0 .config console log report info ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/13 21:41 net-next-old 6e6eda44b939 529798b0 .config console log report info ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/13 21:00 net-next-old 6e6eda44b939 529798b0 .config console log report info ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/13 06:15 net-next-old 55b98837e37d 96166539 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/13 06:14 net-next-old 55b98837e37d 96166539 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/12 11:30 net-next-old 93e71edfd90c 96166539 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/12 00:45 net-next-old 60d86034b14e 96166539 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/11 21:27 net-next-old 60d86034b14e 96166539 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in ethnl_set_plca_cfg
2023/01/16 09:21 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/16 08:37 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/16 07:05 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/15 15:37 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/15 09:25 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/15 09:25 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/15 08:40 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/15 07:26 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/15 00:55 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/14 22:01 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/14 21:00 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/14 20:07 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/14 20:01 linux-next 0a093b2893c7 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/14 00:35 linux-next 0a093b2893c7 529798b0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/13 22:43 linux-next 0a093b2893c7 529798b0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/13 21:41 linux-next 0a093b2893c7 529798b0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/13 20:57 linux-next 0a093b2893c7 529798b0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/13 06:21 linux-next 0a093b2893c7 96166539 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/13 06:07 linux-next 0a093b2893c7 96166539 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/13 01:31 linux-next 0a093b2893c7 96166539 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
2023/01/12 13:47 linux-next 0a093b2893c7 96166539 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in ethnl_set_plca_cfg
* Struck through repros no longer work on HEAD.