================================================================== BUG: KASAN: double-free or invalid-free in kfree_link+0x16/0x20 fs/libfs.c:1105 CPU: 0 PID: 6289 Comm: blkid Not tainted 5.1.0-rc6+ #191 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report_invalid_free+0x65/0xa0 mm/kasan/report.c:278 __kasan_slab_free+0x13a/0x150 mm/kasan/common.c:438 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3499 [inline] kfree+0xcf/0x230 mm/slab.c:3822 kfree_link+0x16/0x20 fs/libfs.c:1105 do_delayed_call include/linux/delayed_call.h:28 [inline] put_link fs/namei.c:881 [inline] step_into fs/namei.c:1770 [inline] do_last fs/namei.c:3381 [inline] path_openat+0x1ca1/0x46e0 fs/namei.c:3533 do_filp_open+0x1a1/0x280 fs/namei.c:3563 do_sys_open+0x3fe/0x5d0 fs/open.c:1069 __do_sys_open fs/open.c:1087 [inline] __se_sys_open fs/open.c:1082 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1082 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f4cfc81c120 Code: 48 8b 15 1b 4d 2b 00 f7 d8 64 89 02 83 c8 ff c3 90 90 90 90 90 90 90 90 90 90 83 3d d5 a4 2b 00 00 75 10 b8 02 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 5e 8c 01 00 48 89 04 24 RSP: 002b:00007ffec5df8748 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007ffec5df9790 RCX: 00007f4cfc81c120 RDX: 00007ffec5df8762 RSI: 0000000000000000 RDI: 00007ffec5df8750 RBP: 0000000000000703 R08: 0000000000000000 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffec5dfa808 R13: 0000000000000000 R14: 00007f4cfccfd820 R15: 00007f4cfcaf32a2 Allocated by task 0: (stack is not available) Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff8880a620c540 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2240 bytes inside of 4096-byte region [ffff8880a620c540, ffff8880a620d540) The buggy address belongs to the page: page:ffffea0002988300 count:1 mapcount:0 mapping:ffff88812c3f0dc0 index:0xffff8880a620d340 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffff88809ac2ae38 ffff88809ac2ae38 ffff88812c3f0dc0 raw: ffff8880a620d340 ffff8880a620c540 00000001fffffff2 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a620cd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a620cd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a620ce00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8880a620ce80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880a620cf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================