================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0x10b/0x150 lib/list_debug.c:51 Read of size 8 at addr ffff88019e990908 by task kworker/u4:6/12960 CPU: 1 PID: 12960 Comm: kworker/u4:6 Not tainted 4.16.0-rc6+ #290 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x24d lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x23c/0x360 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __list_del_entry_valid+0x10b/0x150 lib/list_debug.c:51 __list_del_entry include/linux/list.h:117 [inline] list_del_rcu include/linux/rculist.h:130 [inline] fib_notifier_ops_unregister+0x6d/0x250 net/core/fib_notifier.c:163 fib6_notifier_exit+0x37/0x50 net/ipv6/fib6_notifier.c:62 fib6_net_exit+0x3c4/0x550 net/ipv6/ip6_fib.c:2166 ops_exit_list.isra.6+0xae/0x150 net/core/net_namespace.c:152 cleanup_net+0x4d8/0xa90 net/core/net_namespace.c:523 process_one_work+0xc47/0x1bb0 kernel/workqueue.c:2113 worker_thread+0x223/0x1990 kernel/workqueue.c:2247 kthread+0x33c/0x400 kernel/kthread.c:238 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:406 Allocated by task 5959: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552 __do_kmalloc mm/slab.c:3705 [inline] __kmalloc+0x162/0x760 mm/slab.c:3714 kmalloc include/linux/slab.h:517 [inline] kzalloc include/linux/slab.h:701 [inline] ext4_htree_store_dirent+0x8b/0x580 fs/ext4/dir.c:452 htree_dirblock_to_tree+0x4e8/0xa00 fs/ext4/namei.c:1020 ext4_htree_fill_tree+0x2bb/0xcb0 fs/ext4/namei.c:1097 ext4_dx_readdir fs/ext4/dir.c:576 [inline] ext4_readdir+0x206a/0x3600 fs/ext4/dir.c:123 iterate_dir+0x1ca/0x530 fs/readdir.c:51 SYSC_getdents fs/readdir.c:231 [inline] SyS_getdents+0x225/0x450 fs/readdir.c:212 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 5959: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527 __cache_free mm/slab.c:3485 [inline] kfree+0xd9/0x260 mm/slab.c:3800 free_rb_tree_fname+0x85/0xe0 fs/ext4/dir.c:404 ext4_htree_free_dir_info fs/ext4/dir.c:426 [inline] ext4_release_dir+0x44/0x60 fs/ext4/dir.c:624 __fput+0x327/0x7e0 fs/file_table.c:209 ____fput+0x15/0x20 fs/file_table.c:243 task_work_run+0x199/0x270 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x275/0x2f0 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline] syscall_return_slowpath arch/x86/entry/common.c:265 [inline] do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff88019e990900 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 8 bytes inside of 64-byte region [ffff88019e990900, ffff88019e990940) The buggy address belongs to the page: page:ffffea00067a6400 count:1 mapcount:0 mapping:ffff88019e990000 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff88019e990000 0000000000000000 0000000100000020 raw: ffffea00075e6be0 ffffea00067733a0 ffff8801dac00340 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88019e990800: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88019e990880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88019e990900: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88019e990980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88019e990a00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================