================================================================== BUG: KASAN: slab-out-of-bounds in gether_get_ifname+0xee/0x110 drivers/usb/gadget/function/u_ether.c:1033 Read of size 1 at addr ffff8880261c7042 b Read of size 1 at addr ffff8880261c7042 by task syz.4.885/8590 CPU: 1 UID: 0 PID: 8590 Comm: syz.4.885 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 gether_get_ifname+0xee/0x110 drivers/usb/gadget/function/u_ether.c:1033 f_phonet_ifname_show+0x48/0x60 drivers/usb/gadget/function/f_phonet.c:603 fill_read_buffer fs/configfs/file.c:68 [inline] configfs_read_iter+0x2b7/0x620 fs/configfs/file.c:88 __kernel_read+0x4ca/0x960 fs/read_write.c:532 integrity_kernel_read+0x89/0xd0 security/integrity/iint.c:28 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:222 [inline] ima_calc_file_hash+0x451/0x890 security/integrity/ima/ima_crypto.c:280 ima_collect_measurement+0x51b/0xa00 security/integrity/ima/ima_api.c:300 process_measurement+0x1272/0x1c10 security/integrity/ima/ima_main.c:425 ima_file_check+0xe1/0x130 security/integrity/ima/ima_main.c:685 security_file_post_open+0xb3/0x260 security/security.c:2755 do_open fs/namei.c:4839 [inline] path_openat+0x1485/0x1d60 fs/namei.c:5000 do_file_open+0x23e/0x4a0 fs/namei.c:5029 do_sys_openat2+0x115/0x200 fs/open.c:1417 do_sys_open fs/open.c:1423 [inline] __do_sys_openat fs/open.c:1439 [inline] __se_sys_openat fs/open.c:1434 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1434 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f21d2d9e0d9 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:00007f21d3c38028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f21d3025fa0 RCX: 00007f21d2d9e0d9 RDX: 0000000000000000 RSI: 0000200000000180 RDI: ffffffffffffff9c RBP: 00007f21d2e35024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f21d3026038 R14: 00007f21d3025fa0 R15: 00007fffe6b01f18 Allocated by task 8590: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5414 [inline] __kvmalloc_node_noprof+0x50f/0x820 mm/slub.c:7005 alloc_netdev_mqs+0xa9/0x12b0 net/core/dev.c:12095 gphonet_setup_default drivers/usb/gadget/function/f_phonet.c:706 [inline] phonet_alloc_inst+0xa4/0x180 drivers/usb/gadget/function/f_phonet.c:640 try_get_usb_function_instance drivers/usb/gadget/functions.c:28 [inline] usb_get_function_instance+0xe3/0x2f0 drivers/usb/gadget/functions.c:44 function_make+0x127/0x360 drivers/usb/gadget/configfs.c:626 configfs_mkdir+0x4f6/0x9e0 fs/configfs/dir.c:1360 vfs_mkdir+0x40c/0x620 fs/namei.c:5410 filename_mkdirat+0x285/0x510 fs/namei.c:5443 __do_sys_mkdirat fs/namei.c:5464 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5461 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880261c6000 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 [ffff8880261c6000, ffff8880261c6f08) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x261c0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff8880261c1011 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88813ff1b500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000300040004 00000000f5000000 ffff8880261c1011 head: 00fff00000000040 ffff88813ff1b500 dead000000000100 dead000000000122 head: 0000000000000000 0000000300040004 00000000f5000000 ffff8880261c1011 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 8555, tgid 8555 (syz-executor), ts 196192186842 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x2209/0x2280 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x217/0x5a0 mm/page_alloc.c:5436 alloc_slab_page mm/slub.c:3347 [inline] allocate_slab+0x7d/0x620 mm/slub.c:3462 new_slab mm/slub.c:3513 [inline] refill_objects+0x2d5/0x350 mm/slub.c:7410 refill_sheaf mm/slub.c:2885 [inline] __pcs_replace_empty_main+0x2c8/0x6c0 mm/slub.c:4774 alloc_from_pcs mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:4984 [inline] __do_kmalloc_node mm/slub.c:5413 [inline] __kvmalloc_node_noprof+0x63c/0x820 mm/slub.c:7005 alloc_netdev_mqs+0xa9/0x12b0 net/core/dev.c:12095 rtnl_create_link+0x321/0xd70 net/core/rtnetlink.c:3777 rtnl_newlink_create+0x258/0x7b0 net/core/rtnetlink.c:3959 __rtnl_newlink net/core/rtnetlink.c:4098 [inline] rtnl_newlink+0x166d/0x1c30 net/core/rtnetlink.c:4215 rtnetlink_rcv_msg+0x802/0xc00 net/core/rtnetlink.c:7132 netlink_rcv_skb+0x226/0x4a0 net/netlink/af_netlink.c:2556 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x7bd/0x940 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec+0x13a/0x180 net/socket.c:800 page last free pid 7951 tgid 7951 ts 196113325052 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1418 [inline] __free_frozen_pages+0xc93/0xd90 mm/page_alloc.c:2962 __slab_free+0x274/0x2c0 mm/slub.c:5815 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x99/0x100 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4683 [inline] slab_alloc_node mm/slub.c:4996 [inline] __do_kmalloc_node mm/slub.c:5413 [inline] __kvmalloc_node_noprof+0x49f/0x820 mm/slub.c:7005 seq_buf_alloc fs/seq_file.c:39 [inline] seq_read_iter+0x1ea/0xca0 fs/seq_file.c:211 new_sync_read fs/read_write.c:493 [inline] vfs_read+0x595/0xa80 fs/read_write.c:574 ksys_read+0x150/0x270 fs/read_write.c:716 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880261c6f00: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880261c6f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880261c7000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880261c7080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880261c7100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================