================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xf1/0x100 lib/list_debug.c:51 Read of size 8 at addr ffff8881d778cb70 by task kworker/1:2/3433 CPU: 1 PID: 3433 Comm: kworker/1:2 Not tainted 4.20.0-rc6-next-20181210+ #164 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events_power_efficient neigh_periodic_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.4+0x9/0x1ff mm/kasan/report.c:187 kasan_report.cold.5+0x1b/0x39 mm/kasan/report.c:317 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135 __list_del_entry_valid+0xf1/0x100 lib/list_debug.c:51 __list_del_entry include/linux/list.h:117 [inline] list_del_init include/linux/list.h:159 [inline] neigh_mark_dead+0x13b/0x410 net/core/neighbour.c:125 neigh_periodic_work+0x89a/0xc30 net/core/neighbour.c:905 process_one_work+0xc90/0x1c40 kernel/workqueue.c:2153 worker_thread+0x17f/0x1390 kernel/workqueue.c:2296 kthread+0x35a/0x440 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Allocated by task 6014: save_stack+0x43/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] kasan_kmalloc+0xcb/0xd0 mm/kasan/common.c:482 __do_kmalloc_node mm/slab.c:3671 [inline] __kmalloc_node+0x4d/0x70 mm/slab.c:3678 kmalloc_node include/linux/slab.h:588 [inline] kvmalloc_node+0x65/0xf0 mm/util.c:416 kvmalloc include/linux/mm.h:639 [inline] xt_alloc_table_info+0x42/0xa0 net/netfilter/x_tables.c:1181 do_replace net/ipv6/netfilter/ip6_tables.c:1145 [inline] do_ip6t_set_ctl+0x2dc/0x64b net/ipv6/netfilter/ip6_tables.c:1684 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x7d/0xd0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x105/0x170 net/ipv6/ipv6_sockglue.c:945 tcp_setsockopt+0x93/0xe0 net/ipv4/tcp.c:3068 sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:2986 __sys_setsockopt+0x1ba/0x3c0 net/socket.c:1903 __do_sys_setsockopt net/socket.c:1914 [inline] __se_sys_setsockopt net/socket.c:1911 [inline] __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1911 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 6014: save_stack+0x43/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:444 kasan_slab_free+0xe/0x10 mm/kasan/common.c:452 __cache_free mm/slab.c:3485 [inline] kfree+0xcf/0x230 mm/slab.c:3804 kvfree+0x61/0x70 mm/util.c:445 xt_free_table_info+0x129/0x180 net/netfilter/x_tables.c:1201 __do_replace+0x86a/0xad0 net/ipv6/netfilter/ip6_tables.c:1107 do_replace net/ipv6/netfilter/ip6_tables.c:1160 [inline] do_ip6t_set_ctl+0x49c/0x64b net/ipv6/netfilter/ip6_tables.c:1684 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x7d/0xd0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x105/0x170 net/ipv6/ipv6_sockglue.c:945 tcp_setsockopt+0x93/0xe0 net/ipv4/tcp.c:3068 sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:2986 __sys_setsockopt+0x1ba/0x3c0 net/socket.c:1903 __do_sys_setsockopt net/socket.c:1914 [inline] __se_sys_setsockopt net/socket.c:1911 [inline] __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1911 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8881d778c900 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 624 bytes inside of 1024-byte region [ffff8881d778c900, ffff8881d778cd00) The buggy address belongs to the page: page:ffffea00075de300 count:1 mapcount:0 mapping:ffff8881da800ac0 index:0xffff8881d778db00 compound_mapcount: 0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea0007367808 ffffea00072f3488 ffff8881da800ac0 raw: ffff8881d778db00 ffff8881d778c000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d778ca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d778ca80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881d778cb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881d778cb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d778cc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================