netlink: 26 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 26 bytes leftover after parsing attributes in process `syz-executor0'. ================================================================== 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 ffff888097cb0b88 by task syz-executor0/9618 CPU: 1 PID: 9618 Comm: syz-executor0 Not tainted 4.20.0+ #3 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:arch_local_irq_restore arch/x86/include/asm/paravirt.h:766 [inline] RIP: 0010:console_unlock+0xd46/0x11e0 kernel/printk/printk.c:2416 Code: 48 c1 e8 03 80 3c 08 00 0f 85 d2 03 00 00 48 83 3d 1e 86 2a 08 00 0f 84 b9 02 00 00 e8 f3 db 19 00 48 8b bd 10 ff ff ff 57 9d <0f> 1f 44 00 00 e9 5c ff ff ff e8 db db 19 00 48 8b 7d 08 c7 05 5d RSP: 0018:ffff88806baff158 EFLAGS: 00000216 ORIG_RAX: ffffffffffffff13 RAX: 0000000000040000 RBX: 0000000000000200 RCX: ffffc90011e91000 RDX: 000000000000bede RSI: ffffffff8167ca1d RDI: 0000000000000216 RBP: ffff88806baff278 R08: 0000000000000006 R09: ffff88809fae8db0 R10: ffff88809fae84c0 R11: 0000000000000000 R12: 0000000000000000 R13: ffffffff849e3ab0 R14: ffffffff89f6f5b0 R15: 0000000000016401 vprintk_emit+0x370/0x960 kernel/printk/printk.c:1931 vprintk_default+0x28/0x30 kernel/printk/printk.c:1958 vprintk_func+0x7e/0x189 kernel/printk/printk_safe.c:398 printk+0xba/0xed kernel/printk/printk.c:1991 __nla_parse.cold+0x24/0x37 lib/nlattr.c:425 nla_parse+0x45/0x60 lib/nlattr.c:439 nlmsg_parse include/net/netlink.h:527 [inline] genl_family_rcv_msg+0x56f/0x11a0 net/netlink/genetlink.c:579 genl_rcv_msg+0xca/0x16c net/netlink/genetlink.c:626 netlink_rcv_skb+0x17d/0x410 net/netlink/af_netlink.c:2477 genl_rcv+0x29/0x40 net/netlink/genetlink.c:637 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x574/0x770 net/netlink/af_netlink.c:1336 netlink_sendmsg+0xa05/0xf90 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 ___sys_sendmsg+0x7ec/0x910 net/socket.c:2116 __sys_sendmsg+0x112/0x270 net/socket.c:2154 __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg net/socket.c:2161 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2161 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:00007fddf1107c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457ec9 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000004 RBP: 000000000073bfa0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fddf11086d4 R13: 00000000004c52f9 R14: 00000000004d8d58 R15: 00000000ffffffff Allocated by task 9610: 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 16785: 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 ffff888097cb0a80 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 264 bytes inside of 512-byte region [ffff888097cb0a80, ffff888097cb0c80) The buggy address belongs to the page: page:ffffea00025f2c00 count:1 mapcount:0 mapping:ffff88812c3f0940 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002173ac8 ffffea00025f7648 ffff88812c3f0940 raw: 0000000000000000 ffff888097cb0080 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888097cb0a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888097cb0b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888097cb0b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888097cb0c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888097cb0c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================