syzbot


android-4.4 boot error: KASAN: use-after-free Write in ion_heap_deferred_free

Status: auto-closed as invalid on 2019/12/06 08:51
Reported-by: syzbot+95c250f662218250f74e@syzkaller.appspotmail.com
First crash: 2009d, last: 1932d

Sample crash report:
hidraw: raw HID events driver (C) Jiri Kosina
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
ion_heap_create: Heap type is disabled: 1
kasan: CONFIG_KASAN_INLINE enabled[    3.963691] ==================================================================
BUG: KASAN: use-after-free in register_lock_class kernel/locking/lockdep.c:832 [inline]
BUG: KASAN: use-after-free in __lock_acquire+0x49b0/0x4f80 kernel/locking/lockdep.c:3101
Write of size 8 at addr ffff8800ba24e5d0 by task system/344

CPU: 1 PID: 344 Comm: system Not tainted 4.4.188+ #21
 0000000000000000 c7eb6e9d8ac8a529 ffff8801d7f179f0 ffffffff81ac2711
 0000000000000001 ffffea0002e89380 ffff8800ba24e5d0 0000000000000008
 0000000000000000 ffff8801d7f17a28 ffffffff81494390 0000000000000001
Call Trace:
 [<ffffffff81ac2711>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81ac2711>] dump_stack+0xc1/0x120 lib/dump_stack.c:51
 [<ffffffff81494390>] print_address_description+0x6f/0x21b mm/kasan/report.c:252
 [<ffffffff814945c8>] kasan_report_error mm/kasan/report.c:351 [inline]
 [<ffffffff814945c8>] kasan_report mm/kasan/report.c:408 [inline]
 [<ffffffff814945c8>] kasan_report.cold+0x8c/0x2be mm/kasan/report.c:393
 [<ffffffff814891e7>] __asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:434
 [<ffffffff81207540>] register_lock_class kernel/locking/lockdep.c:832 [inline]
 [<ffffffff81207540>] __lock_acquire+0x49b0/0x4f80 kernel/locking/lockdep.c:3101
 [<ffffffff8120957e>] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592
 [<ffffffff827319c8>] __raw_spin_lock include/linux/spinlock_api_smp.h:144 [inline]
 [<ffffffff827319c8>] _raw_spin_lock+0x38/0x50 kernel/locking/spinlock.c:151
 [<ffffffff821285d0>] spin_lock include/linux/spinlock.h:302 [inline]
 [<ffffffff821285d0>] ion_heap_freelist_size drivers/staging/android/ion/ion_heap.c:176 [inline]
 [<ffffffff821285d0>] ion_heap_deferred_free+0x100/0x500 drivers/staging/android/ion/ion_heap.c:232
 [<ffffffff81137383>] kthread+0x273/0x310 kernel/kthread.c:211
 [<ffffffff82732d05>] ret_from_fork+0x55/0x80 arch/x86/entry/entry_64.S:537

Allocated by task 1:
 [<ffffffff8102f906>] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63
 [<ffffffff81488192>] save_stack mm/kasan/kasan.c:512 [inline]
 [<ffffffff81488192>] set_track mm/kasan/kasan.c:524 [inline]
 [<ffffffff81488192>] kasan_kmalloc.part.0+0x62/0xf0 mm/kasan/kasan.c:616
 [<ffffffff81488407>] kasan_kmalloc+0xb7/0xd0 mm/kasan/kasan.c:601
 [<ffffffff81484413>] kmem_cache_alloc_trace+0x123/0x2d0 mm/slub.c:2642
 [<ffffffff8212c0bb>] kmalloc include/linux/slab.h:476 [inline]
 [<ffffffff8212c0bb>] kzalloc include/linux/slab.h:620 [inline]
 [<ffffffff8212c0bb>] ion_system_heap_create+0x4b/0x2c0 drivers/staging/android/ion/ion_system_heap.c:283
 [<ffffffff82128b26>] ion_heap_create+0x156/0x1b0 drivers/staging/android/ion/ion_heap.c:328
 [<ffffffff83251eca>] ion_dummy_init+0x1e5/0x36d drivers/staging/android/ion/ion_dummy_driver.c:106
 [<ffffffff810003fb>] do_one_initcall+0x13b/0x260 init/main.c:793
 [<ffffffff831d9bce>] do_initcall_level init/main.c:858 [inline]
 [<ffffffff831d9bce>] do_initcalls init/main.c:866 [inline]
 [<ffffffff831d9bce>] do_basic_setup init/main.c:884 [inline]
 [<ffffffff831d9bce>] kernel_init_freeable+0x2fa/0x3c3 init/main.c:1029
 [<ffffffff8271f434>] kernel_init+0x12/0x15e init/main.c:957
 [<ffffffff82732d05>] ret_from_fork+0x55/0x80 arch/x86/entry/entry_64.S:537

Freed by task 1:
 [<ffffffff8102f906>] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63
 [<ffffffff81488a90>] save_stack mm/kasan/kasan.c:512 [inline]
 [<ffffffff81488a90>] set_track mm/kasan/kasan.c:524 [inline]
 [<ffffffff81488a90>] kasan_slab_free+0xb0/0x190 mm/kasan/kasan.c:589
 [<ffffffff81485eb4>] slab_free_hook mm/slub.c:1383 [inline]
 [<ffffffff81485eb4>] slab_free_freelist_hook mm/slub.c:1405 [inline]
 [<ffffffff81485eb4>] slab_free mm/slub.c:2859 [inline]
 [<ffffffff81485eb4>] kfree+0xf4/0x310 mm/slub.c:3749
 [<ffffffff8212c3ca>] ion_system_heap_destroy+0x9a/0xc0 drivers/staging/android/ion/ion_system_heap.c:323
 [<ffffffff82128bea>] ion_heap_destroy+0x6a/0xd0 drivers/staging/android/ion/ion_heap.c:369
 [<ffffffff83251fa6>] ion_dummy_init+0x2c1/0x36d drivers/staging/android/ion/ion_dummy_driver.c:116
 [<ffffffff810003fb>] do_one_initcall+0x13b/0x260 init/main.c:793
 [<ffffffff831d9bce>] do_initcall_level init/main.c:858 [inline]
 [<ffffffff831d9bce>] do_initcalls init/main.c:866 [inline]
 [<ffffffff831d9bce>] do_basic_setup init/main.c:884 [inline]
 [<ffffffff831d9bce>] kernel_init_freeable+0x2fa/0x3c3 init/main.c:1029
 [<ffffffff8271f434>] kernel_init+0x12/0x15e init/main.c:957
 [<ffffffff82732d05>] ret_from_fork+0x55/0x80 arch/x86/entry/entry_64.S:537

The buggy address belongs to the object at ffff8800ba24e500
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 208 bytes inside of
 512-byte region [ffff8800ba24e500, ffff8800ba24e700)
The buggy address belongs to the page:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 4 at kernel/locking/lockdep.c:728 look_up_lock_class kernel/locking/lockdep.c:728 [inline]()
WARNING: CPU: 0 PID: 4 at kernel/locking/lockdep.c:728 register_lock_class kernel/locking/lockdep.c:750 [inline]()
WARNING: CPU: 0 PID: 4 at kernel/locking/lockdep.c:728 __lock_acquire+0x29de/0x4f80 kernel/locking/lockdep.c:3101()

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/08/08 08:50 https://android.googlesource.com/kernel/common android-4.4 886d08593458 e6ebef88 .config console log report ci-android-44-kasan-gce-386
2019/05/23 07:30 https://android.googlesource.com/kernel/common android-4.4 6dc3fb0ba854 0dadcd9d .config console log report ci-android-44-kasan-gce-386
* Struck through repros no longer work on HEAD.