================================================================== BUG: KASAN: slab-out-of-bounds in gether_get_ifname+0x102/0x120 drivers/usb/gadget/function/u_ether.c:1033 Read of size 1 at addr ffff88807dfe5042 by task syz.4.7/5795 CPU: 1 UID: 0 PID: 5795 Comm: syz.4.7 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 gether_get_ifname+0x102/0x120 drivers/usb/gadget/function/u_ether.c:1033 f_phonet_ifname_show+0x43/0x60 drivers/usb/gadget/function/f_phonet.c:603 fill_read_buffer fs/configfs/file.c:68 [inline] configfs_read_iter+0x426/0x6f0 fs/configfs/file.c:88 __kernel_read+0x397/0xad0 fs/read_write.c:532 integrity_kernel_read+0x7e/0xb0 security/integrity/iint.c:28 ima_calc_file_hash_tfm+0x25e/0x350 security/integrity/ima/ima_crypto.c:222 ima_calc_file_hash+0x1e3/0x380 security/integrity/ima/ima_crypto.c:280 ima_collect_measurement+0x94f/0xb30 security/integrity/ima/ima_api.c:300 process_measurement+0xdfe/0x2350 security/integrity/ima/ima_main.c:425 ima_file_check+0xc3/0x110 security/integrity/ima/ima_main.c:685 security_file_post_open+0xc4/0x210 security/security.c:2755 do_open fs/namei.c:4702 [inline] path_openat+0x985/0x4280 fs/namei.c:4863 do_file_open+0x20e/0x430 fs/namei.c:4892 do_sys_openat2+0x10f/0x1e0 fs/open.c:1368 do_sys_open fs/open.c:1374 [inline] __do_sys_openat fs/open.c:1390 [inline] __se_sys_openat fs/open.c:1385 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1385 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f8b0979e0d9 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:00007f8b0a5b3028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f8b09a25fa0 RCX: 00007f8b0979e0d9 RDX: 0000000000000000 RSI: 0000200000000180 RDI: ffffffffffffff9c RBP: 00007f8b09835024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f8b09a26038 R14: 00007f8b09a25fa0 R15: 00007fff09306f58 Allocated by task 5795: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5334 [inline] __kvmalloc_node_noprof+0x34f/0x970 mm/slub.c:6905 alloc_netdev_mqs+0xd7/0x15c0 net/core/dev.c:12059 gphonet_setup_default+0x37/0x80 drivers/usb/gadget/function/f_phonet.c:706 phonet_alloc_inst+0x83/0x130 drivers/usb/gadget/function/f_phonet.c:640 try_get_usb_function_instance+0x136/0x1f0 drivers/usb/gadget/functions.c:28 usb_get_function_instance+0x16/0x70 drivers/usb/gadget/functions.c:44 function_make+0x18c/0x3f0 drivers/usb/gadget/configfs.c:626 configfs_mkdir+0x51e/0xb70 fs/configfs/dir.c:1360 vfs_mkdir+0x361/0x850 fs/namei.c:5276 filename_mkdirat+0x48b/0x5e0 fs/namei.c:5309 __do_sys_mkdirat fs/namei.c:5330 [inline] __se_sys_mkdirat fs/namei.c:5327 [inline] __x64_sys_mkdirat+0x89/0xc0 fs/namei.c:5327 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88807dfe4000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 314 bytes to the right of allocated 3848-byte region [ffff88807dfe4000, ffff88807dfe4f08) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88807dfe6000 pfn:0x7dfe0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88807dfe1011 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801c02c500 ffff88801c02b7c8 ffff88801c02b7c8 raw: ffff88807dfe6000 0000200000040003 00000000f5000000 ffff88807dfe1011 head: 00fff00000000240 ffff88801c02c500 ffff88801c02b7c8 ffff88801c02b7c8 head: ffff88807dfe6000 0000200000040003 00000000f5000000 ffff88807dfe1011 head: 00fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5795, tgid 5794 (syz.4.7), ts 69896217681, free_ts 39167615757 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0xf48/0x3530 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304 alloc_slab_page mm/slub.c:3266 [inline] allocate_slab mm/slub.c:3380 [inline] new_slab+0xa2/0x640 mm/slub.c:3426 refill_objects+0xe3/0x410 mm/slub.c:7310 refill_sheaf mm/slub.c:2804 [inline] __pcs_replace_empty_main+0x376/0x680 mm/slub.c:4675 alloc_from_pcs mm/slub.c:4773 [inline] slab_alloc_node mm/slub.c:4905 [inline] __do_kmalloc_node mm/slub.c:5333 [inline] __kvmalloc_node_noprof+0x793/0x970 mm/slub.c:6905 alloc_netdev_mqs+0xd7/0x15c0 net/core/dev.c:12059 gphonet_setup_default+0x37/0x80 drivers/usb/gadget/function/f_phonet.c:706 phonet_alloc_inst+0x83/0x130 drivers/usb/gadget/function/f_phonet.c:640 try_get_usb_function_instance+0x136/0x1f0 drivers/usb/gadget/functions.c:28 usb_get_function_instance+0x16/0x70 drivers/usb/gadget/functions.c:44 function_make+0x18c/0x3f0 drivers/usb/gadget/configfs.c:626 configfs_mkdir+0x51e/0xb70 fs/configfs/dir.c:1360 vfs_mkdir+0x361/0x850 fs/namei.c:5276 filename_mkdirat+0x48b/0x5e0 fs/namei.c:5309 page last free pid 5261 tgid 5261 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0x79f/0x1090 mm/page_alloc.c:2950 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4584 [inline] slab_alloc_node mm/slub.c:4917 [inline] kmem_cache_alloc_node_noprof+0x27d/0x6b0 mm/slub.c:4989 __alloc_skb+0x140/0x710 net/core/skbuff.c:704 alloc_skb include/linux/skbuff.h:1384 [inline] alloc_skb_with_frags+0xdd/0x760 net/core/skbuff.c:6775 sock_alloc_send_pskb+0x801/0x980 net/core/sock.c:3012 unix_dgram_sendmsg+0x3c7/0x1810 net/unix/af_unix.c:2137 unix_seqpacket_sendmsg+0x12a/0x1d0 net/unix/af_unix.c:2538 sock_sendmsg_nosec net/socket.c:775 [inline] __sock_sendmsg net/socket.c:790 [inline] sock_write_iter+0x53a/0x5b0 net/socket.c:1241 do_iter_readv_writev+0x6f7/0x930 fs/read_write.c:828 vfs_writev+0x360/0xdd0 fs/read_write.c:1058 do_writev+0x28a/0x340 fs/read_write.c:1104 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88807dfe4f00: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807dfe4f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807dfe5000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807dfe5080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807dfe5100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================