syzbot


upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode

Status: upstream: reported on 2025/03/13 01:27
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+353d7b75658a95aa955a@syzkaller.appspotmail.com
First crash: 58d, last: 17h26m
Duplicate bugs (1)
duplicates (1):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
KASAN: slab-use-after-free Write in binder_add_device kernel C 83 3h57m 53d 0/28 closed as dup on 2025/03/25 01:03
Discussions (3)
Title Replies (including bot) Last reply
[syzbot] [kernel?] KASAN: slab-use-after-free Write in binder_add_device 4 (8) 2025/03/25 01:03
[PATCH] binder: fix use-after-free in binderfs_evict_inode() 2 (2) 2025/03/24 20:55
[syzbot] [kernel?] upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode 0 (3) 2025/03/13 09:41
Last patch testing requests (2)
Created Duration User Patch Repo Result
2025/03/13 09:41 14m lizhi.xu@windriver.com patch upstream OK
2025/03/13 05:30 0m lizhi.xu@windriver.com patch upstream error

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in __hlist_del include/linux/list.h:982 [inline]
BUG: KASAN: slab-use-after-free in hlist_del_init include/linux/list.h:1008 [inline]
BUG: KASAN: slab-use-after-free in binderfs_evict_inode+0x1de/0x2d0 drivers/android/binderfs.c:277
Write of size 8 at addr ffff888142bab808 by task syz-executor/5830

CPU: 1 UID: 0 PID: 5830 Comm: syz-executor Not tainted 6.15.0-rc5-syzkaller-00136-g9c69f8884904 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/29/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:408 [inline]
 print_report+0xb4/0x290 mm/kasan/report.c:521
 kasan_report+0x118/0x150 mm/kasan/report.c:634
 __hlist_del include/linux/list.h:982 [inline]
 hlist_del_init include/linux/list.h:1008 [inline]
 binderfs_evict_inode+0x1de/0x2d0 drivers/android/binderfs.c:277
 evict+0x501/0x9c0 fs/inode.c:810
 __dentry_kill+0x209/0x660 fs/dcache.c:660
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1105
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1132
 shrink_dcache_parent+0xa1/0x2c0 fs/dcache.c:-1
 do_one_tree+0x23/0xe0 fs/dcache.c:1595
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1612
 generic_shutdown_super+0x67/0x2c0 fs/super.c:620
 kill_anon_super fs/super.c:1237 [inline]
 kill_litter_super+0x76/0xb0 fs/super.c:1247
 binderfs_kill_super+0x44/0x90 drivers/android/binderfs.c:792
 deactivate_locked_super+0xb9/0x130 fs/super.c:473
 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1435
 task_work_run+0x1d1/0x260 kernel/task_work.c:227
 exit_task_work include/linux/task_work.h:40 [inline]
 do_exit+0x8d6/0x2550 kernel/exit.c:953
 do_group_exit+0x21c/0x2d0 kernel/exit.c:1102
 get_signal+0x125e/0x1310 kernel/signal.c:3034
 arch_do_signal_or_restart+0x95/0x780 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x8b/0x120 kernel/entry/common.c:218
 do_syscall_64+0x103/0x210 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa5ebf8d33d
Code: Unable to access opcode bytes at 0x7fa5ebf8d313.
RSP: 002b:00007fa5ec2dfda8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: fffffffffffffe00 RBX: 0000000000000003 RCX: 00007fa5ebf8d33d
RDX: 0000000000000030 RSI: 00007fa5ec2dfe40 RDI: 00000000000000f9
RBP: 00007fa5ec2dfdec R08: 000000000000000a R09: 00007fa5ec2dfaf7
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000003b
R13: 00000000000927c0 R14: 0000000000011a1b R15: 00007fa5ec2dfe40
 </TASK>

Allocated by task 5829:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
 __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394
 kasan_kmalloc include/linux/kasan.h:260 [inline]
 __kmalloc_cache_noprof+0x230/0x3d0 mm/slub.c:4358
 kmalloc_noprof include/linux/slab.h:905 [inline]
 kzalloc_noprof include/linux/slab.h:1039 [inline]
 binderfs_binder_device_create+0x17f/0xaf0 drivers/android/binderfs.c:147
 binderfs_fill_super+0xa0e/0xe90 drivers/android/binderfs.c:730
 vfs_get_super fs/super.c:1280 [inline]
 get_tree_nodev+0xb8/0x150 fs/super.c:1299
 vfs_get_tree+0x8f/0x2b0 fs/super.c:1759
 do_new_mount+0x24a/0xa40 fs/namespace.c:3884
 do_mount fs/namespace.c:4224 [inline]
 __do_sys_mount fs/namespace.c:4435 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4412
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 5829:
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576
 poison_slab_object mm/kasan/common.c:247 [inline]
 __kasan_slab_free+0x62/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+0x193/0x440 mm/slub.c:4841
 evict+0x501/0x9c0 fs/inode.c:810
 __dentry_kill+0x209/0x660 fs/dcache.c:660
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1105
 shrink_dentry_list+0x2e0/0x5e0 fs/dcache.c:1132
 shrink_dcache_parent+0xa1/0x2c0 fs/dcache.c:-1
 do_one_tree+0x23/0xe0 fs/dcache.c:1595
 shrink_dcache_for_umount+0xa0/0x170 fs/dcache.c:1612
 generic_shutdown_super+0x67/0x2c0 fs/super.c:620
 kill_anon_super fs/super.c:1237 [inline]
 kill_litter_super+0x76/0xb0 fs/super.c:1247
 binderfs_kill_super+0x44/0x90 drivers/android/binderfs.c:792
 deactivate_locked_super+0xb9/0x130 fs/super.c:473
 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1435
 task_work_run+0x1d1/0x260 kernel/task_work.c:227
 exit_task_work include/linux/task_work.h:40 [inline]
 do_exit+0x8d6/0x2550 kernel/exit.c:953
 do_group_exit+0x21c/0x2d0 kernel/exit.c:1102
 get_signal+0x125e/0x1310 kernel/signal.c:3034
 arch_do_signal_or_restart+0x95/0x780 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x8b/0x120 kernel/entry/common.c:218
 do_syscall_64+0x103/0x210 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff888142bab800
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 8 bytes inside of
 freed 512-byte region [ffff888142bab800, ffff888142baba00)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x142ba8
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x57ff00000000040(head|node=1|zone=2|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 057ff00000000040 ffff88801a041c80 ffffea00052d2c00 dead000000000002
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 057ff00000000040 ffff88801a041c80 ffffea00052d2c00 dead000000000002
head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
head: 057ff00000000002 ffffea00050aea01 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 1, tgid 1 (swapper/0), ts 6904634222, free_ts 0
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1718
 prep_new_page mm/page_alloc.c:1726 [inline]
 get_page_from_freelist+0x21ce/0x22b0 mm/page_alloc.c:3688
 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4970
 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301
 alloc_slab_page mm/slub.c:2450 [inline]
 allocate_slab+0x8a/0x3b0 mm/slub.c:2618
 new_slab mm/slub.c:2672 [inline]
 ___slab_alloc+0xbfc/0x1480 mm/slub.c:3858
 __slab_alloc mm/slub.c:3948 [inline]
 __slab_alloc_node mm/slub.c:4023 [inline]
 slab_alloc_node mm/slub.c:4184 [inline]
 __kmalloc_cache_noprof+0x296/0x3d0 mm/slub.c:4353
 kmalloc_noprof include/linux/slab.h:905 [inline]
 kzalloc_noprof include/linux/slab.h:1039 [inline]
 find_valid_gpt block/partitions/efi.c:599 [inline]
 efi_partition+0x31e/0x3430 block/partitions/efi.c:720
 check_partition block/partitions/core.c:141 [inline]
 blk_add_partitions block/partitions/core.c:589 [inline]
 bdev_disk_changed+0x75c/0x14b0 block/partitions/core.c:693
 blkdev_get_whole+0x380/0x510 block/bdev.c:748
 bdev_open+0x31e/0xd30 block/bdev.c:957
 bdev_file_open_by_dev+0x1be/0x240 block/bdev.c:1059
 disk_scan_partitions+0x1c1/0x2c0 block/genhd.c:374
 add_disk_fwnode+0xdbc/0x10e0 block/genhd.c:526
 add_disk include/linux/blkdev.h:757 [inline]
 brd_alloc+0x53b/0x740 drivers/block/brd.c:401
 brd_init+0x122/0x1b0 drivers/block/brd.c:481
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888142bab700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888142bab780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888142bab800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff888142bab880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888142bab900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/09 02:57 upstream 9c69f8884904 dbf35fa1 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode
2025/03/12 19:13 upstream 0fed89a961ea 1a5d9317 .config console log report [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode
2025/05/08 18:13 upstream 2c89c1b655c0 bb813bcc .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64 upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode
2025/05/07 14:40 upstream 707df3375124 350f4ffc .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-compat upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode
2025/05/06 16:53 upstream 0d8d44db295c 350f4ffc .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-mte upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode
2025/05/04 06:43 upstream e8ab83e34bdc b0714e37 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-compat upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode
2025/05/03 07:53 upstream 95d3481af6dc b0714e37 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64 upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode
2025/05/03 07:21 upstream 95d3481af6dc b0714e37 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-compat upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode
2025/05/02 02:35 upstream ebd297a2affa 51b137cd .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-compat upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode
2025/04/30 05:52 upstream b6ea1680d0ac 85a5a23f .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64 upstream test error: KASAN: slab-use-after-free Write in binderfs_evict_inode
* Struck through repros no longer work on HEAD.