KASAN: slab-out-of-bounds Read in gether_get_ifname

Status: upstream: reported C repro on 2026/08/17 09:21
Reported-by: syzbot+07886e96db1f4cfc196d@syzkaller.appspotmail.com
First crash: 9d08h, last: 8d23h
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in gether_get_ifname usb prio:normal 17 syz, C 21 8d12h 5d10h 0/29 upstream: reported C repro on 2026/08/21 07:52

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in gether_get_ifname+0xf0/0x110 drivers/usb/gadget/function/u_ether.c:1046
Read of size 1 at addr ffff0000d90cae02 by task syz.0.17/4506

CPU: 1 PID: 4506 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026
Call trace:
 dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106
 print_address_description+0x88/0x218 mm/kasan/report.c:316
 print_report+0x50/0x68 mm/kasan/report.c:420
 kasan_report+0xa8/0xfc mm/kasan/report.c:524
 __asan_report_load1_noabort+0x2c/0x38 mm/kasan/report_generic.c:348
 gether_get_ifname+0xf0/0x110 drivers/usb/gadget/function/u_ether.c:1046
 f_phonet_ifname_show+0x4c/0x60 drivers/usb/gadget/function/f_phonet.c:603
 fill_read_buffer fs/configfs/file.c:68 [inline]
 configfs_read_iter+0x210/0x4a8 fs/configfs/file.c:88
 call_read_iter include/linux/fs.h:2259 [inline]
 new_sync_read fs/read_write.c:389 [inline]
 vfs_read+0x3cc/0x7b8 fs/read_write.c:470
 ksys_read+0x12c/0x228 fs/read_write.c:613
 __do_sys_read fs/read_write.c:623 [inline]
 __se_sys_read fs/read_write.c:621 [inline]
 __arm64_sys_read+0x7c/0x90 fs/read_write.c:621
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Allocated by task 4506:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:53
 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505
 ____kasan_kmalloc mm/kasan/common.c:375 [inline]
 __kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:384
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slab_common.c:936 [inline]
 __kmalloc_node+0xdc/0x184 mm/slab_common.c:943
 kmalloc_node include/linux/slab.h:589 [inline]
 kvmalloc_node+0x88/0x1d4 mm/util.c:581
 kvmalloc include/linux/slab.h:716 [inline]
 kvzalloc include/linux/slab.h:724 [inline]
 alloc_netdev_mqs+0x94/0xc44 net/core/dev.c:10770
 gphonet_setup_default drivers/usb/gadget/function/f_phonet.c:706 [inline]
 phonet_alloc_inst+0xa4/0x170 drivers/usb/gadget/function/f_phonet.c:640
 try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline]
 usb_get_function_instance+0xe8/0x2dc drivers/usb/gadget/functions.c:44
 function_make+0x108/0x2f8 drivers/usb/gadget/configfs.c:615
 configfs_mkdir+0x3e0/0x884 fs/configfs/dir.c:1360
 vfs_mkdir+0x314/0x4d8 fs/namei.c:4114
 do_mkdirat+0x1b8/0x3ec fs/namei.c:4139
 __do_sys_mkdirat fs/namei.c:4154 [inline]
 __se_sys_mkdirat fs/namei.c:4152 [inline]
 __arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4152
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

The buggy address belongs to the object at ffff0000d90ca000
 which belongs to the cache kmalloc-cg-4k of size 4096
The buggy address is located 3586 bytes inside of
 4096-byte region [ffff0000d90ca000, ffff0000d90cb000)

The buggy address belongs to the physical page:
page:00000000c6d715d9 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1190c8
head:00000000c6d715d9 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff0000c3dd9501
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 fffffc00034e3800 dead000000000003 ffff0000c0003500
raw: 0000000000000000 0000000080040004 00000001ffffffff ffff0000c3dd9501
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000d90cad00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000d90cad80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000d90cae00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                   ^
 ffff0000d90cae80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000d90caf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/17 10:00 linux-6.1.y e4f7d8be268e 746171ee .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in gether_get_ifname
2026/08/17 18:25 linux-6.1.y e4f7d8be268e 905244d6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Read in gether_get_ifname
2026/08/17 18:19 linux-6.1.y e4f7d8be268e 905244d6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Read in gether_get_ifname
2026/08/17 09:40 linux-6.1.y e4f7d8be268e 746171ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in gether_get_ifname
2026/08/17 09:21 linux-6.1.y e4f7d8be268e 746171ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in gether_get_ifname
* Struck through repros no longer work on HEAD.