binder: 19366:19368 got transaction with invalid data ptr binder: 19366:19368 transaction failed 29201/-14, size 8192-0 line 3316 binder: undelivered TRANSACTION_ERROR: 29201 ================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x55/0x60 block/genhd.c:1550 Read of size 8 at addr ffff8801a731d1e0 by task syz-executor.0/18304 CPU: 1 PID: 18304 Comm: syz-executor.0 Not tainted 4.9.202+ #0 ffff8801a493f730 ffffffff81b55d2b 0000000000000000 ffffea00069cc600 ffff8801a731d1e0 0000000000000008 ffffffff81b2a1d5 ffff8801a493f768 ffffffff8150c321 0000000000000000 ffff8801a731d1e0 ffff8801a731d1e0 Call Trace: [<000000001fed4aa6>] __dump_stack lib/dump_stack.c:15 [inline] [<000000001fed4aa6>] dump_stack+0xcb/0x130 lib/dump_stack.c:56 [<000000002ba88017>] print_address_description+0x6f/0x23a mm/kasan/report.c:256 [<00000000101206d4>] kasan_report_error mm/kasan/report.c:355 [inline] [<00000000101206d4>] kasan_report mm/kasan/report.c:413 [inline] [<00000000101206d4>] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:397 [<00000000a6c107e4>] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:434 [<0000000014274122>] disk_unblock_events+0x55/0x60 block/genhd.c:1550 [<000000006a1f4c4d>] __blkdev_get+0x6ba/0xeb0 fs/block_dev.c:1368 [<00000000483a8ea8>] blkdev_get+0x2e8/0x920 fs/block_dev.c:1424 [<0000000006ade06b>] blkdev_open+0x1aa/0x250 fs/block_dev.c:1579 [<00000000773d94cf>] do_dentry_open+0x422/0xd20 fs/open.c:791 [<000000001a0302c0>] vfs_open+0x105/0x230 fs/open.c:904 [<00000000d49a2b39>] do_last fs/namei.c:3457 [inline] [<00000000d49a2b39>] path_openat+0xbf5/0x2f60 fs/namei.c:3581 [<00000000ae430888>] do_filp_open+0x1a1/0x280 fs/namei.c:3615 [<000000001bcc6c6e>] do_sys_open+0x2f0/0x610 fs/open.c:1097 [<00000000c4a9a5e9>] SYSC_open fs/open.c:1115 [inline] [<00000000c4a9a5e9>] SyS_open+0x2d/0x40 fs/open.c:1110 [<00000000c2133302>] do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 [<000000003420ccb7>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb Allocated by task 19314: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack mm/kasan/kasan.c:512 [inline] set_track mm/kasan/kasan.c:524 [inline] kasan_kmalloc.part.0+0x62/0xf0 mm/kasan/kasan.c:616 kasan_kmalloc+0xb7/0xd0 mm/kasan/kasan.c:601 kmem_cache_alloc_trace+0x115/0x2d0 mm/slub.c:2742 kmem_cache_alloc_node_trace include/linux/slab.h:381 [inline] kmalloc_node include/linux/slab.h:528 [inline] kzalloc_node include/linux/slab.h:647 [inline] alloc_disk_node+0x50/0x3c0 block/genhd.c:1294 alloc_disk+0x1b/0x20 block/genhd.c:1286 loop_add+0x37e/0x7d0 drivers/block/loop.c:1850 loop_probe+0x154/0x180 drivers/block/loop.c:1957 kobj_lookup+0x221/0x410 drivers/base/map.c:124 get_gendisk+0x3c/0x2d0 block/genhd.c:716 __blkdev_get+0x356/0xeb0 fs/block_dev.c:1267 blkdev_get+0x2e8/0x920 fs/block_dev.c:1424 blkdev_open+0x1aa/0x250 fs/block_dev.c:1579 do_dentry_open+0x422/0xd20 fs/open.c:791 vfs_open+0x105/0x230 fs/open.c:904 do_last fs/namei.c:3457 [inline] path_openat+0xbf5/0x2f60 fs/namei.c:3581 do_filp_open+0x1a1/0x280 fs/namei.c:3615 do_sys_open+0x2f0/0x610 fs/open.c:1097 SYSC_open fs/open.c:1115 [inline] SyS_open+0x2d/0x40 fs/open.c:1110 do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 entry_SYSCALL_64_after_swapgs+0x5d/0xdb Freed by task 18304: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack mm/kasan/kasan.c:512 [inline] set_track mm/kasan/kasan.c:524 [inline] kasan_slab_free+0xb0/0x190 mm/kasan/kasan.c:589 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+0xfc/0x310 mm/slub.c:3878 disk_release+0x255/0x330 block/genhd.c:1147 device_release+0x7d/0x220 drivers/base/core.c:248 kobject_cleanup lib/kobject.c:643 [inline] kobject_release lib/kobject.c:672 [inline] kref_sub include/linux/kref.h:73 [inline] kref_put include/linux/kref.h:98 [inline] kobject_put+0x150/0x260 lib/kobject.c:689 put_disk+0x23/0x30 block/genhd.c:1358 __blkdev_get+0x61a/0xeb0 fs/block_dev.c:1361 blkdev_get+0x2e8/0x920 fs/block_dev.c:1424 blkdev_open+0x1aa/0x250 fs/block_dev.c:1579 do_dentry_open+0x422/0xd20 fs/open.c:791 vfs_open+0x105/0x230 fs/open.c:904 do_last fs/namei.c:3457 [inline] path_openat+0xbf5/0x2f60 fs/namei.c:3581 do_filp_open+0x1a1/0x280 fs/namei.c:3615 do_sys_open+0x2f0/0x610 fs/open.c:1097 SYSC_open fs/open.c:1115 [inline] SyS_open+0x2d/0x40 fs/open.c:1110 do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 entry_SYSCALL_64_after_swapgs+0x5d/0xdb The buggy address belongs to the object at ffff8801a731cc80 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1376 bytes inside of 2048-byte region [ffff8801a731cc80, ffff8801a731d480) The buggy address belongs to the page: page:ffffea00069cc600 count:1 mapcount:0 mapping: (null) index:0xffff8801a731a200 compound_mapcount: 0 flags: 0x4000000000010200(slab|head) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801a731d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801a731d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801a731d180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801a731d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801a731d280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== binder: 19386:19389 got transaction with invalid data ptr binder: 19386:19389 transaction failed 29201/-14, size 8192-0 line 3316 binder: undelivered TRANSACTION_ERROR: 29201 binder: 19386:19390 got transaction with invalid data ptr binder: 19386:19390 transaction failed 29201/-14, size 8192-0 line 3316 binder: undelivered TRANSACTION_ERROR: 29201