================================================================== BUG: KASAN: use-after-free in dev_map_flush_old kernel/bpf/devmap.c:389 [inline] BUG: KASAN: use-after-free in __dev_map_entry_free+0x2a9/0x330 kernel/bpf/devmap.c:403 Read of size 8 at addr ffff8880992af688 by task ksoftirqd/0/9 CPU: 0 PID: 9 Comm: ksoftirqd/0 Not tainted 5.0.0+ #65 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.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 dev_map_flush_old kernel/bpf/devmap.c:389 [inline] __dev_map_entry_free+0x2a9/0x330 kernel/bpf/devmap.c:403 __rcu_reclaim kernel/rcu/rcu.h:227 [inline] rcu_do_batch kernel/rcu/tree.c:2475 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2788 [inline] rcu_core+0x928/0x1390 kernel/rcu/tree.c:2769 __do_softirq+0x266/0x95a kernel/softirq.c:293 run_ksoftirqd kernel/softirq.c:655 [inline] run_ksoftirqd+0x8e/0x110 kernel/softirq.c:647 smpboot_thread_fn+0x6ab/0xa10 kernel/smpboot.c:164 kthread+0x357/0x430 kernel/kthread.c:253 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Allocated by task 9760: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:497 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:511 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3621 kmalloc include/linux/slab.h:545 [inline] kzalloc include/linux/slab.h:740 [inline] dev_map_alloc kernel/bpf/devmap.c:102 [inline] dev_map_alloc+0x1be/0x6e0 kernel/bpf/devmap.c:88 find_and_alloc_map kernel/bpf/syscall.c:129 [inline] map_create kernel/bpf/syscall.c:526 [inline] __do_sys_bpf+0x946/0x3e50 kernel/bpf/syscall.c:2687 __se_sys_bpf kernel/bpf/syscall.c:2664 [inline] __x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:2664 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7554: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3821 dev_map_free+0x43c/0x540 kernel/bpf/devmap.c:192 bpf_map_free_deferred+0xba/0xf0 kernel/bpf/syscall.c:290 process_one_work+0x98e/0x1790 kernel/workqueue.c:2269 worker_thread+0x98/0xe40 kernel/workqueue.c:2415 kthread+0x357/0x430 kernel/kthread.c:253 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff8880992af580 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 264 bytes inside of 512-byte region [ffff8880992af580, ffff8880992af780) The buggy address belongs to the page: page:ffffea000264abc0 count:1 mapcount:0 mapping:ffff88812c3f0940 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002639388 ffffea00021d65c8 ffff88812c3f0940 raw: 0000000000000000 ffff8880992af080 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880992af580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880992af600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880992af680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880992af700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880992af780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================