ion_heap_create: Heap type is disabled: 1 kasan: CONFIG_KASAN_INLINE enabled sd 0:0:1:0: [sda] Attached SCSI disk kasan: GPF could be caused by NULL-ptr deref or user memory access ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x2f1c/0x4350 kernel/locking/lockdep.c:3224 Read of size 8 at addr ffff8801d6104fc8 by task system/348 CPU: 0 PID: 348 Comm: system Not tainted 4.9.164+ #85 ffff8801d5cbf9e0 ffffffff81b48511 0000000000000000 ffffea0007584100 ffff8801d6104fc8 0000000000000008 ffffffff8120acec ffff8801d5cbfa18 ffffffff81503455 0000000000000000 ffff8801d6104fc8 ffff8801d6104fc8 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x120 lib/dump_stack.c:51 [] print_address_description+0x6f/0x238 mm/kasan/report.c:256 [] kasan_report_error mm/kasan/report.c:355 [inline] [] kasan_report mm/kasan/report.c:412 [inline] [] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:397 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 [] __lock_acquire+0x2f1c/0x4350 kernel/locking/lockdep.c:3224 [] lock_acquire+0x133/0x3d0 kernel/locking/lockdep.c:3756 [] __raw_spin_lock include/linux/spinlock_api_smp.h:144 [inline] [] _raw_spin_lock+0x38/0x50 kernel/locking/spinlock.c:151 [] spin_lock include/linux/spinlock.h:302 [inline] [] ion_heap_freelist_size drivers/staging/android/ion/ion_heap.c:176 [inline] [] ion_heap_deferred_free+0xf9/0x560 drivers/staging/android/ion/ion_heap.c:232 [] kthread+0x278/0x310 kernel/kthread.c:211 [] ret_from_fork+0x5c/0x70 arch/x86/entry/entry_64.S:373 Allocated by task 1: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack mm/kasan/kasan.c:505 [inline] set_track mm/kasan/kasan.c:517 [inline] kasan_kmalloc.part.0+0x62/0xf0 mm/kasan/kasan.c:609 kasan_kmalloc+0xb7/0xd0 mm/kasan/kasan.c:594 kmem_cache_alloc_trace+0x115/0x2d0 mm/slub.c:2742 kmalloc include/linux/slab.h:490 [inline] kzalloc include/linux/slab.h:636 [inline] ion_system_heap_create+0x42/0x1c0 drivers/staging/android/ion/ion_system_heap.c:334 ion_heap_create+0x156/0x1b0 drivers/staging/android/ion/ion_heap.c:328 ion_dummy_init+0x22e/0x3b6 drivers/staging/android/ion/ion_dummy_driver.c:108 do_one_initcall+0xb1/0x1c0 init/main.c:780 do_initcall_level init/main.c:846 [inline] do_initcalls init/main.c:854 [inline] do_basic_setup init/main.c:872 [inline] kernel_init_freeable+0x2ff/0x3c3 init/main.c:1018 kernel_init+0x12/0x163 init/main.c:946 ret_from_fork+0x5c/0x70 arch/x86/entry/entry_64.S:373 Freed by task 1: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack mm/kasan/kasan.c:505 [inline] set_track mm/kasan/kasan.c:517 [inline] kasan_slab_free+0xb0/0x190 mm/kasan/kasan.c:582 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kfree+0xfb/0x310 mm/slub.c:3878 ion_system_heap_destroy+0x72/0x90 drivers/staging/android/ion/ion_system_heap.c:369 ion_heap_destroy+0x6a/0xd0 drivers/staging/android/ion/ion_heap.c:369 ion_dummy_init+0x30a/0x3b6 drivers/staging/android/ion/ion_dummy_driver.c:118 do_one_initcall+0xb1/0x1c0 init/main.c:780 do_initcall_level init/main.c:846 [inline] do_initcalls init/main.c:854 [inline] do_basic_setup init/main.c:872 [inline] kernel_init_freeable+0x2ff/0x3c3 init/main.c:1018 kernel_init+0x12/0x163 init/main.c:946 ret_from_fork+0x5c/0x70 arch/x86/entry/entry_64.S:373 The buggy address belongs to the object at ffff8801d6104f00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 200 bytes inside of 512-byte region [ffff8801d6104f00, ffff8801d6105100) The buggy address belongs to the page: page:ffffea0007584100 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000004080(slab|head) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d6104e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801d6104f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801d6104f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d6105000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d6105080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================