================================================================== BUG: KASAN: use-after-free in disk_unblock_events+0x4b/0x50 block/genhd.c:1644 Read of size 8 at addr ffff8881d449e2e8 by task blkid/5542 CPU: 1 PID: 5542 Comm: blkid Not tainted 4.14.105+ #29 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xb9/0x10e lib/dump_stack.c:53 print_address_description+0x60/0x226 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0x88/0x2a5 mm/kasan/report.c:393 Allocated by task 5530: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.0+0x4f/0xd0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x126/0x310 mm/slub.c:2750 kmem_cache_alloc_node_trace include/linux/slab.h:378 [inline] kmalloc_node include/linux/slab.h:526 [inline] kzalloc_node include/linux/slab.h:672 [inline] alloc_disk_node+0x5b/0x3d0 block/genhd.c:1387 Freed by task 5542: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xb0/0x190 mm/kasan/kasan.c:524 slab_free_hook mm/slub.c:1389 [inline] slab_free_freelist_hook mm/slub.c:1410 [inline] slab_free mm/slub.c:2966 [inline] kfree+0xf5/0x310 mm/slub.c:3897 device_release+0xf4/0x1a0 drivers/base/core.c:822 The buggy address belongs to the object at ffff8881d449dd80 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1384 bytes inside of 2048-byte region [ffff8881d449dd80, ffff8881d449e580) The buggy address belongs to the page: page:ffffea0007512600 count:1 mapcount:0 mapping: (null) index:0xffff8881d449bb80 compound_mapcount: 0 flags: 0x4000000000008100(slab|head) raw: 4000000000008100 0000000000000000 ffff8881d449bb80 00000001000f000d raw: ffffea00074fa220 ffffea000757f620 ffff8881da802800 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d449e180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d449e200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881d449e280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d449e300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d449e380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== kauditd_printk_skb: 276 callbacks suppressed audit: type=1400 audit(1552233652.868:5705): avc: denied { map } for pid=5567 comm="blkid" path="/lib/x86_64-linux-gnu/libuuid.so.1.3.0" dev="sda1" ino=2819 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1552233652.868:5706): avc: denied { map } for pid=5567 comm="blkid" path="/lib/x86_64-linux-gnu/libuuid.so.1.3.0" dev="sda1" ino=2819 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=5585 comm=syz-executor.4 audit: type=1400 audit(1552233652.908:5707): avc: denied { map } for pid=5573 comm="blkid" path="/sbin/blkid" dev="sda1" ino=16128 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 FAT-fs (loop0): bogus number of reserved sectors SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=5593 comm=syz-executor.4 FAT-fs (loop0): Can't find a valid FAT filesystem audit: type=1400 audit(1552233652.928:5708): avc: denied { create } for pid=5549 comm="syz-executor.5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1552233652.928:5709): avc: denied { write } for pid=5549 comm="syz-executor.5" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_generic_socket permissive=1 audit: type=1400 audit(1552233652.938:5710): avc: denied { map } for pid=5573 comm="blkid" path="/sbin/blkid" dev="sda1" ino=16128 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1552233652.938:5711): avc: denied { map } for pid=5573 comm="blkid" path="/lib/x86_64-linux-gnu/ld-2.13.so" dev="sda1" ino=2668 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1552233652.948:5712): avc: denied { map } for pid=5573 comm="blkid" path="/lib/x86_64-linux-gnu/ld-2.13.so" dev="sda1" ino=2668 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1552233652.958:5713): avc: denied { map } for pid=5579 comm="modprobe" path="/bin/kmod" dev="sda1" ino=1440 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1 audit: type=1400 audit(1552233652.958:5714): avc: denied { map } for pid=5573 comm="blkid" path="/etc/ld.so.cache" dev="sda1" ino=2503 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1