================================================================== BUG: KASAN: use-after-free in br_netfilter_sysctl_exit_net net/bridge/br_netfilter_hooks.c:1121 [inline] BUG: KASAN: use-after-free in brnf_exit_net+0x2a0/0x2c0 net/bridge/br_netfilter_hooks.c:1141 Read of size 8 at addr ffff88808b86e560 by task kworker/u4:5/3000 CPU: 0 PID: 3000 Comm: kworker/u4:5 Not tainted 5.2.0-rc5+ #1 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:77 [inline] dump_stack+0x113/0x167 lib/dump_stack.c:113 print_address_description.cold.5+0x9/0x1ff mm/kasan/report.c:188 __kasan_report.cold.6+0x1b/0x39 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 br_netfilter_sysctl_exit_net net/bridge/br_netfilter_hooks.c:1121 [inline] brnf_exit_net+0x2a0/0x2c0 net/bridge/br_netfilter_hooks.c:1141 ops_exit_list.isra.5+0x8b/0x120 net/core/net_namespace.c:154 cleanup_net+0x363/0x850 net/core/net_namespace.c:553 process_one_work+0x830/0x16a0 kernel/workqueue.c:2269 worker_thread+0x85/0xb60 kernel/workqueue.c:2415 kthread+0x324/0x3e0 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 9066: save_stack+0x21/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc.constprop.8+0xc7/0xd0 mm/kasan/common.c:489 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503 __do_kmalloc mm/slab.c:3660 [inline] __kmalloc+0x15d/0x760 mm/slab.c:3669 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:742 [inline] __register_sysctl_table+0xaa/0xdf0 fs/proc/proc_sysctl.c:1323 register_net_sysctl+0x10/0x20 net/sysctl_net.c:121 br_netfilter_sysctl_init_net net/bridge/br_netfilter_hooks.c:1105 [inline] brnf_init_net+0x334/0x5d0 net/bridge/br_netfilter_hooks.c:1126 ops_init+0x95/0x370 net/core/net_namespace.c:130 setup_net+0x2c1/0x660 net/core/net_namespace.c:316 copy_net_ns+0x199/0x2a0 net/core/net_namespace.c:439 create_new_namespaces+0x487/0x760 kernel/nsproxy.c:103 unshare_nsproxy_namespaces+0x87/0x1a0 kernel/nsproxy.c:202 ksys_unshare+0x31b/0x710 kernel/fork.c:2692 __do_sys_unshare kernel/fork.c:2760 [inline] __se_sys_unshare kernel/fork.c:2758 [inline] __x64_sys_unshare+0x2c/0x40 kernel/fork.c:2758 do_syscall_64+0xd0/0x530 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9: save_stack+0x21/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3432 [inline] kfree+0xcf/0x220 mm/slab.c:3755 __rcu_reclaim kernel/rcu/rcu.h:215 [inline] rcu_do_batch kernel/rcu/tree.c:2092 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2310 [inline] rcu_core+0xc8e/0x1430 kernel/rcu/tree.c:2291 __do_softirq+0x260/0x958 kernel/softirq.c:292 The buggy address belongs to the object at ffff88808b86e540 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 32 bytes inside of 512-byte region [ffff88808b86e540, ffff88808b86e740) The buggy address belongs to the page: page:ffffea00022e1b80 refcount:1 mapcount:0 mapping:ffff8880aa400940 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0001d81dc8 ffffea00027bf648 ffff8880aa400940 raw: 0000000000000000 ffff88808b86e040 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808b86e400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808b86e480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88808b86e500: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff88808b86e580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808b86e600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================