RDX: 0000000000000004 RSI: 00000000000001ff RDI: 00000000200000c0 RBP: 0000000000000000 R08: 0000000000000000 R09: 000000000000000a R10: 0000000000000075 R11: 0000000000000246 R12: 0000000000000004 R13: 0000000000000000 R14: 00000000004d8fb0 R15: 0000000000000003 ================================================================== 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+0x2ab/0x300 kernel/bpf/devmap.c:403 Read of size 8 at addr ffff8881cbb0f388 by task ksoftirqd/1/16 CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 4.20.0-rc3+ #121 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+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 dev_map_flush_old kernel/bpf/devmap.c:389 [inline] __dev_map_entry_free+0x2ab/0x300 kernel/bpf/devmap.c:403 __rcu_reclaim kernel/rcu/rcu.h:240 [inline] rcu_do_batch kernel/rcu/tree.c:2437 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2716 [inline] rcu_process_callbacks+0x100a/0x1ac0 kernel/rcu/tree.c:2697 __do_softirq+0x308/0xb7e kernel/softirq.c:292 run_ksoftirqd+0x5e/0x100 kernel/softirq.c:654 smpboot_thread_fn+0x68b/0xa00 kernel/smpboot.c:164 kthread+0x35a/0x440 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Allocated by task 25258: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620 kmalloc include/linux/slab.h:546 [inline] kzalloc include/linux/slab.h:741 [inline] dev_map_alloc+0x210/0x800 kernel/bpf/devmap.c:102 find_and_alloc_map kernel/bpf/syscall.c:129 [inline] map_create+0x3bd/0x1110 kernel/bpf/syscall.c:509 __do_sys_bpf kernel/bpf/syscall.c:2489 [inline] __se_sys_bpf kernel/bpf/syscall.c:2466 [inline] __x64_sys_bpf+0x303/0x520 kernel/bpf/syscall.c:2466 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 24401: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 dev_map_free+0x514/0x690 kernel/bpf/devmap.c:192 bpf_map_free_deferred+0xd9/0x110 kernel/bpf/syscall.c:290 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 The buggy address belongs to the object at ffff8881cbb0f280 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 264 bytes inside of 512-byte region [ffff8881cbb0f280, ffff8881cbb0f480) The buggy address belongs to the page: page:ffffea00072ec3c0 count:1 mapcount:0 mapping:ffff8881da800940 index:0x0 flags: 0x2fffc0000000200(slab) raw: 02fffc0000000200 ffffea0006f75388 ffffea000719d4c8 ffff8881da800940 raw: 0000000000000000 ffff8881cbb0f000 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881cbb0f280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881cbb0f300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881cbb0f380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881cbb0f400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881cbb0f480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================