RBP: 00007f4ad0e11e19 R08: 00000000000007ff R09: 0000000000000000 R10: 0000000000000006 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f4ad0fb6038 R14: 00007f4ad0fb5fa0 R15: 00007ffc23021bf8 ================================================================== BUG: KASAN: slab-use-after-free in gpiolib_seq_stop+0xc6/0xe0 drivers/gpio/gpiolib.c:5306 Read of size 4 at addr ffff888146f6fe44 by task syz.2.358/7808 CPU: 0 UID: 0 PID: 7808 Comm: syz.2.358 Not tainted 6.17.0-rc1-syzkaller-00004-g53e760d89498 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 gpiolib_seq_stop+0xc6/0xe0 drivers/gpio/gpiolib.c:5306 seq_read_iter+0x60d/0x12c0 fs/seq_file.c:251 seq_read+0x3a3/0x570 fs/seq_file.c:162 full_proxy_read+0x131/0x1a0 fs/debugfs/file.c:378 do_loop_readv_writev fs/read_write.c:847 [inline] do_loop_readv_writev fs/read_write.c:835 [inline] vfs_readv+0x5be/0x8b0 fs/read_write.c:1020 do_preadv+0x1a6/0x270 fs/read_write.c:1132 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x490 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4ad0d8ebe9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4ad1b7d038 EFLAGS: 00000246 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00007f4ad0fb5fa0 RCX: 00007f4ad0d8ebe9 RDX: 000000000000000a RSI: 0000200000000180 RDI: 0000000000000003 RBP: 00007f4ad0e11e19 R08: 00000000000007ff R09: 0000000000000000 R10: 0000000000000006 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f4ad0fb6038 R14: 00007f4ad0fb5fa0 R15: 00007ffc23021bf8 Allocated by task 7808: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:405 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] gpiolib_seq_start+0x69/0x270 drivers/gpio/gpiolib.c:5271 traverse.part.0.constprop.0+0xac/0x640 fs/seq_file.c:106 traverse fs/seq_file.c:98 [inline] seq_read_iter+0x932/0x12c0 fs/seq_file.c:195 seq_read+0x3a3/0x570 fs/seq_file.c:162 full_proxy_read+0x131/0x1a0 fs/debugfs/file.c:378 do_loop_readv_writev fs/read_write.c:847 [inline] do_loop_readv_writev fs/read_write.c:835 [inline] vfs_readv+0x5be/0x8b0 fs/read_write.c:1020 do_preadv+0x1a6/0x270 fs/read_write.c:1132 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x490 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 7808: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x60/0x70 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kfree+0x2b4/0x4d0 mm/slub.c:4879 traverse.part.0.constprop.0+0x2c0/0x640 fs/seq_file.c:131 traverse fs/seq_file.c:98 [inline] seq_read_iter+0x932/0x12c0 fs/seq_file.c:195 seq_read+0x3a3/0x570 fs/seq_file.c:162 full_proxy_read+0x131/0x1a0 fs/debugfs/file.c:378 do_loop_readv_writev fs/read_write.c:847 [inline] do_loop_readv_writev fs/read_write.c:835 [inline] vfs_readv+0x5be/0x8b0 fs/read_write.c:1020 do_preadv+0x1a6/0x270 fs/read_write.c:1132 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x490 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888146f6fe40 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 4 bytes inside of freed 8-byte region [ffff888146f6fe40, ffff888146f6fe48) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888146f6fca0 pfn:0x146f6f flags: 0x57ff00000000000(node=1|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 057ff00000000000 ffff88801b841500 dead000000000100 dead000000000122 raw: ffff888146f6fca0 000000008080007f 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1, tgid 1 (swapper/0), ts 21262348495, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab mm/slub.c:2655 [inline] new_slab+0x247/0x330 mm/slub.c:2709 ___slab_alloc+0xcf2/0x1740 mm/slub.c:3891 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3981 __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] __do_kmalloc_node mm/slub.c:4364 [inline] __kmalloc_node_track_caller_noprof+0x2ee/0x510 mm/slub.c:4384 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x53/0x100 mm/util.c:84 kstrdup_const+0x63/0x80 mm/util.c:104 __kernfs_new_node+0x9b/0x8e0 fs/kernfs/dir.c:633 kernfs_new_node+0x13c/0x1e0 fs/kernfs/dir.c:713 kernfs_create_link+0xcc/0x240 fs/kernfs/symlink.c:39 sysfs_do_create_link_sd+0x90/0x140 fs/sysfs/symlink.c:44 sysfs_do_create_link fs/sysfs/symlink.c:80 [inline] sysfs_create_link+0x61/0xc0 fs/sysfs/symlink.c:92 device_create_sys_dev_entry drivers/base/core.c:3515 [inline] device_add+0xb14/0x1aa0 drivers/base/core.c:3659 page_owner free stack trace missing Memory state around the buggy address: ffff888146f6fd00: fa fc fc fc 05 fc fc fc 06 fc fc fc 06 fc fc fc ffff888146f6fd80: 06 fc fc fc 05 fc fc fc fa fc fc fc 00 fc fc fc >ffff888146f6fe00: 00 fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc ^ ffff888146f6fe80: 05 fc fc fc 05 fc fc fc fa fc fc fc fa fc fc fc ffff888146f6ff00: fa fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc ==================================================================