syzbot


upstream test error: KASAN: slab-use-after-free Write in binder_add_device (3)

Status: closed as invalid on 2025/05/04 07:31
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+57ff869c12cb6d89393d@syzkaller.appspotmail.com
First crash: 4d10h, last: 1d14h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [kernel?] upstream test error: KASAN: slab-use-after-free Write in binder_add_device (3) 1 (2) 2025/05/04 07:31
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream upstream test error: KASAN: slab-use-after-free Write in binder_add_device kernel 84 95d 96d 0/28 closed as invalid on 2025/02/28 07:58
upstream upstream test error: KASAN: slab-use-after-free Write in binder_add_device (2) kernel 2 52d 48d 0/28 closed as invalid on 2025/03/17 03:39

Sample crash report:
==================================================================
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+0xf4/0xf8 drivers/android/binder.c:6932
Write of size 8 at addr b7f0000014f4e208 by task syz-executor/3305
Pointer tag: [b7], memory tag: [a6]

CPU: 0 UID: 0 PID: 3305 Comm: syz-executor Not tainted 6.14.0-rc2-syzkaller-g29281a76709c #0
Hardware name: linux,dummy-virt (DT)
Call trace:
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:466 (C)
 __dump_stack+0x30/0x40 lib/dump_stack.c:94
 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120
 print_address_description+0xac/0x290 mm/kasan/report.c:378
 print_report+0x84/0xa0 mm/kasan/report.c:489
 kasan_report+0xb0/0x110 mm/kasan/report.c:602
 kasan_tag_mismatch+0x28/0x3c mm/kasan/sw_tags.c:175
 __hwasan_tag_mismatch+0x30/0x60 arch/arm64/lib/kasan_sw_tags.S:55
 hlist_add_head include/linux/list.h:1026 [inline]
 binder_add_device+0xf4/0xf8 drivers/android/binder.c:6932
 binderfs_binder_device_create+0xbfc/0xc28 drivers/android/binderfs.c:210
 binderfs_fill_super+0xb30/0xe20 drivers/android/binderfs.c:729
 vfs_get_super fs/super.c:1280 [inline]
 get_tree_nodev+0xdc/0x1cc fs/super.c:1299
 binderfs_fs_context_get_tree+0x28/0x38 drivers/android/binderfs.c:749
 vfs_get_tree+0xc4/0x3cc fs/super.c:1814
 do_new_mount+0x2a0/0x988 fs/namespace.c:3560
 path_mount+0x650/0x101c fs/namespace.c:3887
 do_mount fs/namespace.c:3900 [inline]
 __do_sys_mount fs/namespace.c:4111 [inline]
 __se_sys_mount fs/namespace.c:4088 [inline]
 __arm64_sys_mount+0x36c/0x468 fs/namespace.c:4088
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x90/0x2b4 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0x180/0x2f4 arch/arm64/kernel/syscall.c:132
 do_el0_svc+0x58/0x74 arch/arm64/kernel/syscall.c:151
 el0_svc+0x58/0x134 arch/arm64/kernel/entry-common.c:744
 el0t_64_sync_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:762
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600

Allocated by task 3297:
 kasan_save_stack+0x40/0x6c mm/kasan/common.c:47
 save_stack_info+0x30/0x138 mm/kasan/tags.c:106
 kasan_save_alloc_info+0x14/0x20 mm/kasan/tags.c:142
 poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
 __kasan_kmalloc+0x8c/0x90 mm/kasan/common.c:394
 kasan_kmalloc include/linux/kasan.h:260 [inline]
 __kmalloc_cache_noprof+0x2a0/0x404 mm/slub.c:4325
 kmalloc_noprof include/linux/slab.h:901 [inline]
 kzalloc_noprof include/linux/slab.h:1037 [inline]
 binderfs_binder_device_create+0x1ac/0xc28 drivers/android/binderfs.c:147
 binderfs_fill_super+0xb30/0xe20 drivers/android/binderfs.c:729
 vfs_get_super fs/super.c:1280 [inline]
 get_tree_nodev+0xdc/0x1cc fs/super.c:1299
 binderfs_fs_context_get_tree+0x28/0x38 drivers/android/binderfs.c:749
 vfs_get_tree+0xc4/0x3cc fs/super.c:1814
 do_new_mount+0x2a0/0x988 fs/namespace.c:3560
 path_mount+0x650/0x101c fs/namespace.c:3887
 do_mount fs/namespace.c:3900 [inline]
 __do_sys_mount fs/namespace.c:4111 [inline]
 __se_sys_mount fs/namespace.c:4088 [inline]
 __arm64_sys_mount+0x36c/0x468 fs/namespace.c:4088
 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
 invoke_syscall+0x90/0x2b4 arch/arm64/kernel/syscall.c:49
 el0_svc_common+0x180/0x2f4 arch/arm64/kernel/syscall.c:132
 do_el0_svc+0x58/0x74 arch/arm64/kernel/syscall.c:151
 el0_svc+0x58/0x134 arch/arm64/kernel/entry-common.c:744
 el0t_64_sync_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:762
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600

Freed by task 3297:
 kasan_save_stack+0x40/0x6c mm/kasan/common.c:47
 save_stack_info+0x30/0x138 mm/kasan/tags.c:106
 kasan_save_free_info+0x18/0x24 mm/kasan/tags.c:147
 poison_slab_object mm/kasan/common.c:247 [inline]
 __kasan_slab_free+0x64/0x68 mm/kasan/common.c:264
 kasan_slab_free include/linux/kasan.h:233 [inline]
 slab_free_hook mm/slub.c:2353 [inline]
 slab_free mm/slub.c:4609 [inline]
 kfree+0x148/0x44c mm/slub.c:4757
 binderfs_evict_inode+0x1e8/0x2b8 drivers/android/binderfs.c:278
 evict+0x4d4/0xbe8 fs/inode.c:796
 iput_final fs/inode.c:1946 [inline]
 iput+0x928/0x9e0 fs/inode.c:1972
 dentry_unlink_inode+0x624/0x660 fs/dcache.c:440
 __dentry_kill+0x224/0x808 fs/dcache.c:643
 shrink_kill+0xd4/0x2cc fs/dcache.c:1088
 shrink_dentry_list+0x420/0x970 fs/dcache.c:1115
 shrink_dcache_parent+0x80/0x200 fs/dcache.c:-1
 do_one_tree+0x2c/0x148 fs/dcache.c:1578
 shrink_dcache_for_umount+0xb0/0x198 fs/dcache.c:1595
 generic_shutdown_super+0x84/0x424 fs/super.c:620
 kill_anon_super fs/super.c:1237 [inline]
 kill_litter_super+0xa4/0xdc fs/super.c:1247
 binderfs_kill_super+0x50/0xcc drivers/android/binderfs.c:791
 deactivate_locked_super+0xf0/0x17c fs/super.c:473
 deactivate_super+0xf4/0x104 fs/super.c:506
 cleanup_mnt+0x3fc/0x484 fs/namespace.c:1413
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1420
 task_work_run+0x1bc/0x254 kernel/task_work.c:227
 exit_task_work include/linux/task_work.h:40 [inline]
 do_exit+0x740/0x23b0 kernel/exit.c:938
 do_group_exit+0x1d4/0x2ac kernel/exit.c:1087
 get_signal+0x1440/0x1554 kernel/signal.c:3036
 do_signal+0x23c/0x3ecc arch/arm64/kernel/signal.c:1658
 do_notify_resume+0x78/0x27c arch/arm64/kernel/entry-common.c:148
 exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:169 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:178 [inline]
 el0_svc+0xb0/0x134 arch/arm64/kernel/entry-common.c:745
 el0t_64_sync_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:762
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600

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

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x54f4e
anon flags: 0x1ffc00000000000(node=0|zone=0|lastcpupid=0x7ff|kasantag=0x0)
page_type: f5(slab)
raw: 01ffc00000000000 7ef000000c801900 0000000000000000 0000000000000001
raw: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 fff0000014f4e000: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29
 fff0000014f4e100: 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29
>fff0000014f4e200: a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6 a6
                   ^
 fff0000014f4e300: a6 fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
 fff0000014f4e400: 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/02 20:46 git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git fuzzme 29281a76709c b0714e37 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-native-arm64-kvm upstream test error: KASAN: slab-use-after-free Write in binder_add_device
2025/05/01 13:13 git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git fuzzme 29281a76709c 51b137cd .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-native-arm64-kvm upstream test error: KASAN: slab-use-after-free Write in binder_add_device
2025/05/01 01:11 git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git fuzzme 29281a76709c ce7952f4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-native-arm64-kvm upstream test error: KASAN: slab-use-after-free Write in binder_add_device
2025/04/30 13:10 git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git fuzzme 29281a76709c 937aafd7 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-native-arm64-kvm upstream test error: KASAN: slab-use-after-free Write in binder_add_device
2025/04/30 00:59 git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git fuzzme 29281a76709c 85a5a23f .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-native-arm64-kvm upstream test error: KASAN: slab-use-after-free Write in binder_add_device
* Struck through repros no longer work on HEAD.