==================================================================
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 ffff888090177388 by task syz-executor2/19577
CPU: 1 PID: 19577 Comm: syz-executor2 Not tainted 4.20.0+ #4
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+0x1db/0x2d0 lib/dump_stack.c:113
print_address_description.cold+0x7c/0x20d mm/kasan/report.c:256
kasan_report_error mm/kasan/report.c:354 [inline]
kasan_report mm/kasan/report.c:412 [inline]
kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396
__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+0x2a9/0x330 kernel/bpf/devmap.c:403
__rcu_reclaim kernel/rcu/rcu.h:240 [inline]
rcu_do_batch kernel/rcu/tree.c:2452 [inline]
invoke_rcu_callbacks kernel/rcu/tree.c:2773 [inline]
rcu_process_callbacks+0xc4a/0x1680 kernel/rcu/tree.c:2754
__do_softirq+0x30b/0xb11 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x180/0x1d0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0x1b7/0x760 arch/x86/kernel/apic/apic.c:1062
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
RIP: 0010:unwind_next_frame+0x3c/0x50 arch/x86/kernel/unwind_frame.c:381
Code: 48 89 e5 48 83 ec 08 0f b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 0f 8b 17 31 c0 85 d2 74 05 e8 35 f5 ff ff c9 48 89 7d f8 e8 4a f0 8c 00 48 8b 7d f8 eb e2 0f 1f 40 00 55 48
RSP: 0018:ffff888084b0efb8 EFLAGS: 00000292 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000001 RBX: ffff888084b0f060 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 1ffff11010961e00 RDI: ffff888084b0f008
RBP: ffff888084b0f040 R08: 0000000000000001 R09: ffff888084b0f010
R10: ffff888084b0efe8 R11: ffff888084b0eff8 R12: 0000000000000000
R13: 0000000000000000 R14: ffff88806c3e22c0 R15: ffff88812c3f0c40
save_stack_trace+0x1a/0x20 arch/x86/kernel/stacktrace.c:60
save_stack+0x45/0xd0 mm/kasan/kasan.c:448
netlink: 26 bytes leftover after parsing attributes in process `syz-executor1'.
set_track mm/kasan/kasan.c:460 [inline]
kasan_kmalloc mm/kasan/kasan.c:553 [inline]
kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531
__do_kmalloc mm/slab.c:3722 [inline]
__kmalloc+0x15d/0x750 mm/slab.c:3731
kmalloc include/linux/slab.h:551 [inline]
kzalloc include/linux/slab.h:741 [inline]
__register_sysctl_table+0xc7/0xff0 fs/proc/proc_sysctl.c:1306
register_net_sysctl+0x29/0x30 net/sysctl_net.c:120
__addrconf_sysctl_register+0x221/0x430 net/ipv6/addrconf.c:6747
addrconf_sysctl_register net/ipv6/addrconf.c:6794 [inline]
addrconf_sysctl_register+0x140/0x1e0 net/ipv6/addrconf.c:6783
ipv6_add_dev net/ipv6/addrconf.c:446 [inline]
ipv6_add_dev+0xb34/0x12c0 net/ipv6/addrconf.c:366
addrconf_notify+0xa12/0x25f0 net/ipv6/addrconf.c:3452
notifier_call_chain+0x179/0x380 kernel/notifier.c:93
__raw_notifier_call_chain kernel/notifier.c:394 [inline]
raw_notifier_call_chain+0x2e/0x40 kernel/notifier.c:401
call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1739
call_netdevice_notifiers_extack net/core/dev.c:1751 [inline]
call_netdevice_notifiers net/core/dev.c:1765 [inline]
register_netdevice+0xae0/0x10b0 net/core/dev.c:8658
tun_set_iff drivers/net/tun.c:2833 [inline]
__tun_chr_ioctl+0x3247/0x45c0 drivers/net/tun.c:3067
tun_chr_ioctl+0x2b/0x40 drivers/net/tun.c:3339
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:509 [inline]
do_vfs_ioctl+0x107b/0x17d0 fs/ioctl.c:696
ksys_ioctl+0xab/0xd0 fs/ioctl.c:713
__do_sys_ioctl fs/ioctl.c:720 [inline]
__se_sys_ioctl fs/ioctl.c:718 [inline]
__x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718
do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457ec9
Code: 6d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fbd50eb4c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457ec9
RDX: 0000000020000000 RSI: 00000000400454ca RDI: 0000000000000005
RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fbd50eb56d4
R13: 00000000004c2197 R14: 00000000004d45b8 R15: 00000000ffffffff
Allocated by task 19578:
save_stack+0x45/0xd0 mm/kasan/kasan.c:448
set_track mm/kasan/kasan.c:460 [inline]
kasan_kmalloc mm/kasan/kasan.c:553 [inline]
kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531
kmem_cache_alloc_trace+0x152/0x760 mm/slab.c:3620
kmalloc include/linux/slab.h:546 [inline]
kzalloc include/linux/slab.h:741 [inline]
dev_map_alloc kernel/bpf/devmap.c:102 [inline]
dev_map_alloc+0x205/0x800 kernel/bpf/devmap.c:88
find_and_alloc_map kernel/bpf/syscall.c:129 [inline]
map_create kernel/bpf/syscall.c:510 [inline]
__do_sys_bpf+0x6df/0x4410 kernel/bpf/syscall.c:2603
__se_sys_bpf kernel/bpf/syscall.c:2580 [inline]
__x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:2580
do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Freed by task 14163:
save_stack+0x45/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+0x522/0x6b0 kernel/bpf/devmap.c:192
bpf_map_free_deferred+0xba/0xf0 kernel/bpf/syscall.c:290
process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153
worker_thread+0x143/0x14a0 kernel/workqueue.c:2296
kthread+0x357/0x430 kernel/kthread.c:246
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
The buggy address belongs to the object at ffff888090177280
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 264 bytes inside of
512-byte region [ffff888090177280, ffff888090177480)
The buggy address belongs to the page:
page:ffffea0002405dc0 count:1 mapcount:0 mapping:ffff88812c3f0940 index:0x0
flags: 0x1fffc0000000200(slab)
raw: 01fffc0000000200 ffffea00028319c8 ffffea000219c988 ffff88812c3f0940
raw: 0000000000000000 ffff888090177000 0000000100000006 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff888090177280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888090177300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888090177380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888090177400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888090177480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================