KASAN: global-out-of-bounds Read in kernfs_new_node

Status: premoderation: reported on 2026/11/27 19:54
Reported-by: syzbot+1b96bae86ed00e293bac@syzkaller.appspotmail.com
First crash: 20h02m, last: 20h02m
▶ ▼ Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Read in kernfs_new_node 19 1 492d 492d 0/3 auto-obsoleted due to no activity on 2025/11/01 08:19
upstream KASAN: slab-use-after-free Read in kernfs_new_node (2) actionable prio:high kernfs 19 3 198d 182d 0/30 auto-obsoleted due to no activity on 2026/08/22 10:12
linux-6.1 KASAN: use-after-free Read in kernfs_new_node (2) 19 1 1d23h 1d23h 0/3 upstream: reported on 2026/11/26 16:32
upstream KASAN: slab-use-after-free Read in kernfs_new_node kernfs 19 1 355d 351d 0/30 auto-obsoleted due to no activity on 2026/03/18 05:27

Sample crash report:
==================================================================
BUG: KASAN: global-out-of-bounds in kernfs_new_node+0x21c/0x260 fs/kernfs/dir.c:727
Read of size 2 at addr ffffffff8575d912 by task syz.3.785/3799

CPU: 1 PID: 3799 Comm: syz.3.785 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
 __dump_stack+0x21/0x24 lib/dump_stack.c:77
 dump_stack_lvl+0x1a7/0x208 lib/dump_stack.c:118
 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:435 [inline]
 kasan_report+0x100/0x140 mm/kasan/report.c:452
 __asan_report_load2_noabort+0x14/0x20 mm/kasan/report_generic.c:307
 kernfs_new_node+0x21c/0x260 fs/kernfs/dir.c:727
 kernfs_create_dir_ns+0x47/0x130 fs/kernfs/dir.c:1087
 sysfs_create_dir_ns+0x128/0x290 fs/sysfs/dir.c:59
 create_dir lib/kobject.c:89 [inline]
 kobject_add_internal+0x774/0xde0 lib/kobject.c:263
 kobject_add_varg lib/kobject.c:398 [inline]
 kobject_add+0x165/0x230 lib/kobject.c:450
 device_add+0x3d8/0xc00 drivers/base/core.c:3208
 device_create_groups_vargs drivers/base/core.c:3962 [inline]
 device_create+0x26c/0x300 drivers/base/core.c:4004
 create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31
 create_alsa_device drivers/usb/gadget/function/f_midi.c:1266 [inline]
 f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1307
 try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline]
 usb_get_function_instance+0xe2/0x2f0 drivers/usb/gadget/functions.c:44
 function_make+0x118/0x350 drivers/usb/gadget/configfs.c:636
 configfs_mkdir+0x5d2/0xd90 fs/configfs/dir.c:1378
 vfs_mkdir+0x42c/0x600 fs/namei.c:3840
 do_mkdirat+0x14c/0x340 fs/namei.c:3862
 __do_sys_mkdirat fs/namei.c:3873 [inline]
 __se_sys_mkdirat fs/namei.c:3871 [inline]
 __x64_sys_mkdirat+0x7b/0x90 fs/namei.c:3871
 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f181cb8ab59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f181b5d8028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f181ce16fa0 RCX: 00007f181cb8ab59
RDX: 00000000000001ff RSI: 0000200000000140 RDI: ffffffffffffff9c
RBP: 00007f181cc1b18b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f181ce17038 R14: 00007f181ce16fa0 R15: 00007fff8c05f908

The buggy address belongs to the variable:
 brport_attr_proxyarp+0x52/0x60

Memory state around the buggy address:
 ffffffff8575d800: 00 00 05 f9 f9 f9 f9 f9 00 00 00 00 00 f9 f9 f9
 ffffffff8575d880: f9 f9 f9 f9 00 01 f9 f9 00 00 00 00 00 f9 f9 f9
>ffffffff8575d900: f9 f9 f9 f9 00 06 f9 f9 00 00 00 00 00 f9 f9 f9
                         ^
 ffffffff8575d980: f9 f9 f9 f9 00 00 f9 f9 00 00 00 00 00 f9 f9 f9
 ffffffff8575da00: f9 f9 f9 f9 00 00 f9 f9 00 00 00 00 00 f9 f9 f9
==================================================================
general protection fault, probably for non-canonical address 0xdffffc0000000004: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000020-0x0000000000000027]
CPU: 1 PID: 3799 Comm: syz.3.785 Tainted: G    B             syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:idr_alloc_cyclic+0x4e/0x1a0 lib/idr.c:121
Code: 04 25 28 00 00 00 48 89 45 d0 49 be 00 00 00 00 00 fc ff df e8 03 a2 0a ff 49 8d 4c 24 14 48 89 4d c0 48 c1 e9 03 48 89 4d a8 <42> 0f b6 04 31 84 c0 0f 85 f8 00 00 00 45 8b 7c 24 14 31 ff 89 de
RSP: 0018:ffffc90001b27538 EFLAGS: 00010203
RAX: ffffffff825a2f0d RBX: 0000000000000000 RCX: 0000000000000004
RDX: ffffc9000c305000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90001b27590 R08: 0000000000000a20 R09: 0000000000000004
R10: dffffc0000000000 R11: fffff52000364ea4 R12: 0000000000000010
R13: 0000000000000001 R14: dffffc0000000000 R15: 1ffff92000364ebc
FS:  00007f181b5d86c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f181b5b7d58 CR3: 0000000116558000 CR4: 00000000003526a0
DR0: 0000000000000000 DR1: 0000000000008000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __kernfs_new_node+0x130/0x670 fs/kernfs/dir.c:669
 kernfs_new_node+0x150/0x260 fs/kernfs/dir.c:739
 kernfs_create_dir_ns+0x47/0x130 fs/kernfs/dir.c:1087
 sysfs_create_dir_ns+0x128/0x290 fs/sysfs/dir.c:59
 create_dir lib/kobject.c:89 [inline]
 kobject_add_internal+0x774/0xde0 lib/kobject.c:263
 kobject_add_varg lib/kobject.c:398 [inline]
 kobject_add+0x165/0x230 lib/kobject.c:450
 device_add+0x3d8/0xc00 drivers/base/core.c:3208
 device_create_groups_vargs drivers/base/core.c:3962 [inline]
 device_create+0x26c/0x300 drivers/base/core.c:4004
 create_function_device+0x60/0x70 drivers/usb/gadget/configfs.c:31
 create_alsa_device drivers/usb/gadget/function/f_midi.c:1266 [inline]
 f_midi_alloc_inst+0x1a8/0x380 drivers/usb/gadget/function/f_midi.c:1307
 try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline]
 usb_get_function_instance+0xe2/0x2f0 drivers/usb/gadget/functions.c:44
 function_make+0x118/0x350 drivers/usb/gadget/configfs.c:636
 configfs_mkdir+0x5d2/0xd90 fs/configfs/dir.c:1378
 vfs_mkdir+0x42c/0x600 fs/namei.c:3840
 do_mkdirat+0x14c/0x340 fs/namei.c:3862
 __do_sys_mkdirat fs/namei.c:3873 [inline]
 __se_sys_mkdirat fs/namei.c:3871 [inline]
 __x64_sys_mkdirat+0x7b/0x90 fs/namei.c:3871
 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f181cb8ab59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f181b5d8028 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 00007f181ce16fa0 RCX: 00007f181cb8ab59
RDX: 00000000000001ff RSI: 0000200000000140 RDI: ffffffffffffff9c
RBP: 00007f181cc1b18b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f181ce17038 R14: 00007f181ce16fa0 R15: 00007fff8c05f908
Modules linked in:
---[ end trace a174dba78cd5a6fd ]---
RIP: 0010:idr_alloc_cyclic+0x4e/0x1a0 lib/idr.c:121
Code: 04 25 28 00 00 00 48 89 45 d0 49 be 00 00 00 00 00 fc ff df e8 03 a2 0a ff 49 8d 4c 24 14 48 89 4d c0 48 c1 e9 03 48 89 4d a8 <42> 0f b6 04 31 84 c0 0f 85 f8 00 00 00 45 8b 7c 24 14 31 ff 89 de
RSP: 0018:ffffc90001b27538 EFLAGS: 00010203

RAX: ffffffff825a2f0d RBX: 0000000000000000 RCX: 0000000000000004
RDX: ffffc9000c305000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90001b27590 R08: 0000000000000a20 R09: 0000000000000004
R10: dffffc0000000000 R11: fffff52000364ea4 R12: 0000000000000010
R13: 0000000000000001 R14: dffffc0000000000 R15: 1ffff92000364ebc
FS:  00007f181b5d86c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f181b5b7d58 CR3: 0000000116558000 CR4: 00000000003526a0
DR0: 0000000000000000 DR1: 0000000000008000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	04 25                	add    $0x25,%al
   2:	28 00                	sub    %al,(%rax)
   4:	00 00                	add    %al,(%rax)
   6:	48 89 45 d0          	mov    %rax,-0x30(%rbp)
   a:	49 be 00 00 00 00 00 	movabs $0xdffffc0000000000,%r14
  11:	fc ff df
  14:	e8 03 a2 0a ff       	call   0xff0aa21c
  19:	49 8d 4c 24 14       	lea    0x14(%r12),%rcx
  1e:	48 89 4d c0          	mov    %rcx,-0x40(%rbp)
  22:	48 c1 e9 03          	shr    $0x3,%rcx
  26:	48 89 4d a8          	mov    %rcx,-0x58(%rbp)
* 2a:	42 0f b6 04 31       	movzbl (%rcx,%r14,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	0f 85 f8 00 00 00    	jne    0x12f
  37:	45 8b 7c 24 14       	mov    0x14(%r12),%r15d
  3c:	31 ff                	xor    %edi,%edi
  3e:	89 de                	mov    %ebx,%esi

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/27 19:53 android13-5.10-lts b1ee1137bb9a bff1a522 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: global-out-of-bounds Read in kernfs_new_node
* Struck through repros no longer work on HEAD.