================================================================== BUG: KASAN: slab-use-after-free in hlist_add_head include/linux/list.h:1026 [inline] BUG: KASAN: slab-use-after-free in binder_add_device+0xa4/0xb0 drivers/android/binder.c:6932 Write of size 8 at addr ffff88801392d008 by task syz-executor/14218 CPU: 0 UID: 0 PID: 14218 Comm: syz-executor Not tainted 6.15.0-syzkaller-10769-g7d4e49a77d99 #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 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:408 [inline] print_report+0xcd/0x680 mm/kasan/report.c:521 kasan_report+0xe0/0x110 mm/kasan/report.c:634 hlist_add_head include/linux/list.h:1026 [inline] binder_add_device+0xa4/0xb0 drivers/android/binder.c:6932 binderfs_binder_device_create.isra.0+0xa03/0xc30 drivers/android/binderfs.c:210 binderfs_fill_super+0x8d4/0x1360 drivers/android/binderfs.c:730 vfs_get_super fs/super.c:1323 [inline] get_tree_nodev+0xdd/0x190 fs/super.c:1342 vfs_get_tree+0x8e/0x340 fs/super.c:1802 do_new_mount fs/namespace.c:3856 [inline] path_mount+0x14d4/0x1f70 fs/namespace.c:4180 do_mount fs/namespace.c:4193 [inline] __do_sys_mount fs/namespace.c:4404 [inline] __se_sys_mount fs/namespace.c:4381 [inline] __x64_sys_mount+0x28d/0x310 fs/namespace.c:4381 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0651b9010a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007ffed1e7d558 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f0651c10e74 RCX: 00007f0651b9010a RDX: 00007f0651c208cb RSI: 00007f0651c10e74 RDI: 00007f0651c208cb RBP: 00007f0651c110bd R08: 0000000000000000 R09: 00007f0651db6738 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0651bec1a8 R13: 00007f0651bec180 R14: 0000000000000009 R15: 0000000000000000 Allocated by task 14306: 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:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] alloc_bprm+0x86/0x6f0 fs/exec.c:1409 kernel_execve+0xb0/0x3b0 fs/exec.c:1880 call_usermodehelper_exec_async+0x255/0x4c0 kernel/umh.c:109 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 14306: 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:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2380 [inline] slab_free mm/slub.c:4642 [inline] kfree+0x2b4/0x4d0 mm/slub.c:4841 kernel_execve+0x2fe/0x3b0 fs/exec.c:1917 call_usermodehelper_exec_async+0x255/0x4c0 kernel/umh.c:109 ret_from_fork+0x5d7/0x6f0 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88801392d000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of freed 512-byte region [ffff88801392d000, ffff88801392d200) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1392c head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b842c80 ffffea0000d27100 dead000000000002 raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b842c80 ffffea0000d27100 dead000000000002 head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea00004e4b01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 11273, tgid 11272 (syz.4.1778), ts 166589860644, free_ts 165938744372 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x1321/0x3890 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:4959 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2419 alloc_slab_page mm/slub.c:2450 [inline] allocate_slab mm/slub.c:2618 [inline] new_slab+0x23b/0x330 mm/slub.c:2672 ___slab_alloc+0xd9c/0x1940 mm/slub.c:3858 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3948 __slab_alloc_node mm/slub.c:4023 [inline] slab_alloc_node mm/slub.c:4184 [inline] __do_kmalloc_node mm/slub.c:4326 [inline] __kmalloc_noprof+0x2f2/0x510 mm/slub.c:4339 kmalloc_noprof include/linux/slab.h:909 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] copy_splice_read+0x1a8/0xba0 fs/splice.c:337 do_splice_read fs/splice.c:978 [inline] do_splice_read+0x2bd/0x370 fs/splice.c:953 splice_direct_to_actor+0x2a1/0xa30 fs/splice.c:1083 do_splice_direct_actor fs/splice.c:1201 [inline] do_splice_direct+0x174/0x240 fs/splice.c:1227 do_sendfile+0xb06/0xe50 fs/read_write.c:1370 __do_sys_sendfile64 fs/read_write.c:1431 [inline] __se_sys_sendfile64 fs/read_write.c:1417 [inline] __x64_sys_sendfile64+0x1d8/0x220 fs/read_write.c:1417 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 11183 tgid 11183 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1248 [inline] __free_frozen_pages+0x7fe/0x1180 mm/page_alloc.c:2706 vfree+0x1fd/0xb50 mm/vmalloc.c:3426 vb2_vmalloc_put drivers/media/common/videobuf2/videobuf2-vmalloc.c:68 [inline] vb2_vmalloc_put+0x7b/0xc0 drivers/media/common/videobuf2/videobuf2-vmalloc.c:63 __vb2_buf_mem_free+0x15a/0x2d0 drivers/media/common/videobuf2/videobuf2-core.c:275 __vb2_free_mem drivers/media/common/videobuf2/videobuf2-core.c:571 [inline] __vb2_queue_free+0x7ee/0xa30 drivers/media/common/videobuf2/videobuf2-core.c:599 vb2_core_queue_release+0x70/0x190 drivers/media/common/videobuf2/videobuf2-core.c:2695 v4l2_m2m_ctx_release+0x1e/0x40 drivers/media/v4l2-core/v4l2-mem2mem.c:1276 vicodec_release+0x9c/0x150 drivers/media/test-drivers/vicodec/vicodec-core.c:1948 v4l2_release+0x232/0x460 drivers/media/v4l2-core/v4l2-dev.c:458 __fput+0x402/0xb70 fs/file_table.c:465 task_work_run+0x14d/0x240 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xeb/0x110 kernel/entry/common.c:114 exit_to_user_mode_prepare include/linux/entry-common.h:330 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:414 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:449 [inline] do_syscall_64+0x3f6/0x4c0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88801392cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801392cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801392d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801392d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801392d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================