syzbot


general protection fault in rfkill_register

Status: closed as dup on 2023/09/04 07:57
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+0e04fda096b0ca4f4d6c@syzkaller.appspotmail.com
First crash: 573d, last: 551d
Cause bisection: introduced by (bisect log) :
commit d21fdd07cea418c0d98c8a15fc95b8b8970801e7
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Thu Aug 17 09:12:21 2023 +0000

  driver core: Return proper error code when dev_set_name() fails

Crash: BUG: unable to handle kernel NULL pointer dereference in rfkill_register (log)
Repro: C syz .config
  
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
general protection fault in netdev_register_kobject kernel C done 512 540d 575d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [kernel?] general protection fault in rfkill_register 1 (2) 2023/09/04 07:57

Sample crash report:
RSP: 002b:00007ffe97f81168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007ffe97f81180 RCX: 00007f67bdcebcf9
RDX: 0000000000000002 RSI: 0000000020000300 RDI: ffffffffffffff9c
RBP: 0000000000000002 R08: 00007ffe97f80f06 R09: 00000000000000a0
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe97f8117c
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 5078 Comm: syz-executor255 Not tainted 6.5.0-syzkaller-11812-g7733171926cc #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
RIP: 0010:strchr+0x1b/0xb0 lib/string.c:329
Code: d6 ad f7 48 8b 74 24 08 48 8b 14 24 eb 89 90 f3 0f 1e fa 48 b8 00 00 00 00 00 fc ff df 48 89 fa 55 48 c1 ea 03 53 48 83 ec 10 <0f> b6 04 02 48 89 fa 83 e2 07 38 d0 7f 04 84 c0 75 51 0f b6 07 89
RSP: 0018:ffffc900041a75f0 EFLAGS: 00010286
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000025 RDI: 0000000000000000
RBP: ffffc900041a7680 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: ffffffff8a3cfd58 R12: ffffc900041a7680
R13: 0000000000000cc0 R14: ffff888076cb7018 R15: 0000000000000001
FS:  0000555556cde380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000310 CR3: 0000000071d58000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 kvasprintf_const+0x25/0x190 lib/kasprintf.c:45
 kobject_set_name_vargs+0x5a/0x130 lib/kobject.c:272
 kobject_add_varg lib/kobject.c:366 [inline]
 kobject_add+0x12a/0x240 lib/kobject.c:424
 device_add+0x290/0x1ac0 drivers/base/core.c:3560
 rfkill_register+0x1a9/0xb00 net/rfkill/core.c:1070
 nfc_register_device+0x11f/0x3c0 net/nfc/core.c:1132
 nci_register_device+0x7f4/0xb80 net/nfc/nci/core.c:1257
 virtual_ncidev_open+0x147/0x220 drivers/nfc/virtual_ncidev.c:148
 misc_open+0x3da/0x4c0 drivers/char/misc.c:165
 chrdev_open+0x277/0x700 fs/char_dev.c:414
 do_dentry_open+0x88b/0x1730 fs/open.c:929
 do_open fs/namei.c:3639 [inline]
 path_openat+0x19af/0x29c0 fs/namei.c:3796
 do_filp_open+0x1de/0x430 fs/namei.c:3823
 do_sys_openat2+0x176/0x1e0 fs/open.c:1422
 do_sys_open fs/open.c:1437 [inline]
 __do_sys_openat fs/open.c:1453 [inline]
 __se_sys_openat fs/open.c:1448 [inline]
 __x64_sys_openat+0x175/0x210 fs/open.c:1448
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f67bdcebcf9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 00 00 90 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:00007ffe97f81168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007ffe97f81180 RCX: 00007f67bdcebcf9
RDX: 0000000000000002 RSI: 0000000020000300 RDI: ffffffffffffff9c
RBP: 0000000000000002 R08: 00007ffe97f80f06 R09: 00000000000000a0
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe97f8117c
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:strchr+0x1b/0xb0 lib/string.c:329
Code: d6 ad f7 48 8b 74 24 08 48 8b 14 24 eb 89 90 f3 0f 1e fa 48 b8 00 00 00 00 00 fc ff df 48 89 fa 55 48 c1 ea 03 53 48 83 ec 10 <0f> b6 04 02 48 89 fa 83 e2 07 38 d0 7f 04 84 c0 75 51 0f b6 07 89
RSP: 0018:ffffc900041a75f0 EFLAGS: 00010286
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000025 RDI: 0000000000000000
RBP: ffffc900041a7680 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: ffffffff8a3cfd58 R12: ffffc900041a7680
R13: 0000000000000cc0 R14: ffff888076cb7018 R15: 0000000000000001
FS:  0000555556cde380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000310 CR3: 0000000071d58000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	ad                   	lods   %ds:(%rsi),%eax
   1:	f7 48 8b 74 24 08 48 	testl  $0x48082474,-0x75(%rax)
   8:	8b 14 24             	mov    (%rsp),%edx
   b:	eb 89                	jmp    0xffffff96
   d:	90                   	nop
   e:	f3 0f 1e fa          	endbr64
  12:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  19:	fc ff df
  1c:	48 89 fa             	mov    %rdi,%rdx
  1f:	55                   	push   %rbp
  20:	48 c1 ea 03          	shr    $0x3,%rdx
  24:	53                   	push   %rbx
  25:	48 83 ec 10          	sub    $0x10,%rsp
* 29:	0f b6 04 02          	movzbl (%rdx,%rax,1),%eax <-- trapping instruction
  2d:	48 89 fa             	mov    %rdi,%rdx
  30:	83 e2 07             	and    $0x7,%edx
  33:	38 d0                	cmp    %dl,%al
  35:	7f 04                	jg     0x3b
  37:	84 c0                	test   %al,%al
  39:	75 51                	jne    0x8c
  3b:	0f b6 07             	movzbl (%rdi),%eax
  3e:	89                   	.byte 0x89

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/06 08:19 upstream 7733171926cc 8bc9053e .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce general protection fault in rfkill_register
2023/09/02 05:47 upstream b84acc11b1c9 696ea0d2 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in rfkill_register
2023/09/05 13:14 upstream 3f86ed6ec0b3 8bc9053e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in rfkill_register
2023/09/04 03:11 upstream 6e32dfcccfcc 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in rfkill_register
2023/09/03 22:52 upstream 6e32dfcccfcc 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in rfkill_register
2023/09/03 09:47 upstream 92901222f83d 696ea0d2 .config console log report info ci-upstream-kasan-gce-selinux-root general protection fault in rfkill_register
2023/09/02 05:29 upstream b84acc11b1c9 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in rfkill_register
2023/09/16 03:38 upstream e42bebf6db29 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in rfkill_register
2023/09/15 12:17 upstream 9fdfb15a3dbf 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in rfkill_register
2023/09/14 18:19 upstream aed8aee11130 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in rfkill_register
2023/09/14 07:47 upstream 23f108dc9ed2 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in rfkill_register
2023/09/08 21:21 upstream a48fa7efaf11 019310ab .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in rfkill_register
2023/09/04 02:49 upstream 708283abf896 696ea0d2 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in rfkill_register
2023/09/02 17:35 upstream 0468be89b3fa 696ea0d2 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream general protection fault in rfkill_register
2023/09/06 13:17 upstream 65d6e954e378 736a3c37 .config console log report info ci-qemu-upstream-386 general protection fault in rfkill_register
2023/09/03 18:56 upstream 92901222f83d 696ea0d2 .config console log report info ci-qemu-upstream-386 general protection fault in rfkill_register
2023/09/23 10:50 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 9f564b92cf6d 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 KASAN: null-ptr-deref Read in rfkill_register
* Struck through repros no longer work on HEAD.