================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x55/0x60 block/genhd.c:1543 Read of size 8 at addr ffff8800b6658568 by task blkid/2107 CPU: 1 PID: 2107 Comm: blkid Not tainted 4.4.174+ #17 0000000000000000 e68d831b4a90efda ffff8800b671f730 ffffffff81aad1a1 0000000000000000 ffffea0002d99600 ffff8800b6658568 0000000000000008 0000000000000000 ffff8800b671f768 ffffffff81490120 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x120 lib/dump_stack.c:51 [] print_address_description+0x6f/0x21b mm/kasan/report.c:252 [] kasan_report_error mm/kasan/report.c:351 [inline] [] kasan_report mm/kasan/report.c:408 [inline] [] kasan_report.cold+0x8c/0x2be mm/kasan/report.c:393 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:429 [] disk_unblock_events+0x55/0x60 block/genhd.c:1543 [] __blkdev_get+0x70c/0xdf0 fs/block_dev.c:1297 [] blkdev_get+0x2e8/0x920 fs/block_dev.c:1353 [] blkdev_open+0x1aa/0x250 fs/block_dev.c:1508 [] do_dentry_open+0x38f/0xbd0 fs/open.c:749 [] vfs_open+0x10b/0x210 fs/open.c:862 [] do_last fs/namei.c:3269 [inline] [] path_openat+0x136f/0x4470 fs/namei.c:3406 [] do_filp_open+0x1a1/0x270 fs/namei.c:3440 [] do_sys_open+0x2f8/0x600 fs/open.c:1038 [] SYSC_open fs/open.c:1056 [inline] [] SyS_open+0x2d/0x40 fs/open.c:1051 [] entry_SYSCALL_64_fastpath+0x1e/0x9a Allocated by task 2101: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] 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+0x123/0x2d0 mm/slub.c:2642 [] kmem_cache_alloc_node_trace include/linux/slab.h:367 [inline] [] kmalloc_node include/linux/slab.h:514 [inline] [] kzalloc_node include/linux/slab.h:631 [inline] [] alloc_disk_node+0x50/0x3c0 block/genhd.c:1282 [] alloc_disk+0x1b/0x20 block/genhd.c:1274 [] loop_add+0x380/0x830 drivers/block/loop.c:1857 [] loop_control_ioctl+0x215/0x2f0 drivers/block/loop.c:2014 [] C_SYSC_ioctl fs/compat_ioctl.c:1592 [inline] [] compat_SyS_ioctl+0x403/0x2210 fs/compat_ioctl.c:1544 [] do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] [] do_fast_syscall_32+0x32d/0xa90 arch/x86/entry/common.c:397 [] sysenter_flags_fixed+0xd/0x1a Freed by task 2107: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] 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:1383 [inline] [] slab_free_freelist_hook mm/slub.c:1405 [inline] [] slab_free mm/slub.c:2859 [inline] [] kfree+0xf4/0x310 mm/slub.c:3749 [] disk_release+0x255/0x330 block/genhd.c:1118 [] device_release+0x7d/0x220 drivers/base/core.c:247 [] 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+0x14c/0x260 lib/kobject.c:689 [] put_disk+0x23/0x30 block/genhd.c:1346 [] __blkdev_get+0x66c/0xdf0 fs/block_dev.c:1290 [] blkdev_get+0x2e8/0x920 fs/block_dev.c:1353 [] blkdev_open+0x1aa/0x250 fs/block_dev.c:1508 [] do_dentry_open+0x38f/0xbd0 fs/open.c:749 [] vfs_open+0x10b/0x210 fs/open.c:862 [] do_last fs/namei.c:3269 [inline] [] path_openat+0x136f/0x4470 fs/namei.c:3406 [] do_filp_open+0x1a1/0x270 fs/namei.c:3440 [] do_sys_open+0x2f8/0x600 fs/open.c:1038 [] SYSC_open fs/open.c:1056 [inline] [] SyS_open+0x2d/0x40 fs/open.c:1051 [] entry_SYSCALL_64_fastpath+0x1e/0x9a The buggy address belongs to the object at ffff8800b6658000 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1384 bytes inside of 2048-byte region [ffff8800b6658000, ffff8800b6658800) The buggy address belongs to the page: kernel tried to execute NX-protected page - exploit attempt? (uid: 0) BUG: unable to handle kernel paging request at ffff8800b6617d90 IP: [] 0xffff8800b6617d90 PGD 49a2067 PUD 21ffff067 PMD 80000000b66001e3 Oops: 0011 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 0 PID: 2281 Comm: init Not tainted 4.4.174+ #17 task: ffff8801d34c17c0 task.stack: ffff8801d3488000 RIP: 0010:[] [] 0xffff8800b6617d90 RSP: 0018:ffff8801db607dd8 EFLAGS: 00010006 RAX: ffff8801d34c17c0 RBX: ffff8800b6617d48 RCX: ffff8801d34c2088 RDX: 0000000000010000 RSI: ffffffff8125fa56 RDI: ffff8800b6617d48 RBP: ffff8801db607ee8 R08: 0000000000000003 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8800b6617d90 R13: dffffc0000000000 R14: ffff8801db6192c0 R15: 0000000000000000 FS: 00007f274e14e7a0(0000) GS:ffff8801db600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff8800b6617d90 CR3: 00000001d47fe000 CR4: 00000000001606b0 Stack: ffffffff8125fa5e 0000000000000000 ffff8801db607e80 0000000000000002 1ffff1003b6c0fc8 ffffed003b6c0fd0 ffff88021fffd01b 000000011fffd00f fffffbfff05f7178 ffff8801db619380 ffff8801db6192f8 ffff8801db619398 Call Trace: [] hrtimer_interrupt+0x1b6/0x450 kernel/time/hrtimer.c:1359 [] local_apic_timer_interrupt+0x76/0xa0 arch/x86/kernel/apic/apic.c:901 [] smp_apic_timer_interrupt+0x79/0xb0 arch/x86/kernel/apic/apic.c:925 [] apic_timer_interrupt+0x9d/0xb0 arch/x86/entry/entry_64.S:768 [] console_device+0x97/0xc0 kernel/printk/printk.c:2443 [] tty_lookup_driver drivers/tty/tty_io.c:2000 [inline] [] tty_open+0x8e7/0xf50 drivers/tty/tty_io.c:2068 [] chrdev_open+0x230/0x630 fs/char_dev.c:388 [] do_dentry_open+0x38f/0xbd0 fs/open.c:749 [] vfs_open+0x10b/0x210 fs/open.c:862 [] do_last fs/namei.c:3269 [inline] [] path_openat+0x136f/0x4470 fs/namei.c:3406 [] do_filp_open+0x1a1/0x270 fs/namei.c:3440 [] do_sys_open+0x2f8/0x600 fs/open.c:1038 [] SYSC_open fs/open.c:1056 [inline] [] SyS_open+0x2d/0x40 fs/open.c:1051 [] entry_SYSCALL_64_fastpath+0x1e/0x9a Code: 88 ff ff 00 80 65 b6 00 88 ff ff 90 7d 61 b6 00 88 ff ff 50 ac 42 81 ff ff ff ff 00 96 d9 02 00 ea ff ff e0 1b 89 82 ff ff ff ff 7d 61 b6 00 88 ff ff 16 ac 42 81 ff ff ff ff 00 00 60 b7 00 RIP [] 0xffff8800b6617d90 RSP CR2: ffff8800b6617d90 ---[ end trace 54c4f42152d780e6 ]---