================================================================== BUG: KASAN: use-after-free in __get_unaligned_cpu32 include/linux/unaligned/packed_struct.h:19 [inline] BUG: KASAN: use-after-free in mc_hash drivers/net/macvlan.c:255 [inline] BUG: KASAN: use-after-free in macvlan_broadcast+0x57c/0x660 drivers/net/macvlan.c:281 Read of size 4 at addr ffff88808d201501 by task syz-executor.5/16061 CPU: 0 PID: 16061 Comm: syz-executor.5 Not tainted 4.19.93-syzkaller #0 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+0x197/0x210 lib/dump_stack.c:118 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_load_n_noabort+0xf/0x20 mm/kasan/report.c:443 __get_unaligned_cpu32 include/linux/unaligned/packed_struct.h:19 [inline] mc_hash drivers/net/macvlan.c:255 [inline] macvlan_broadcast+0x57c/0x660 drivers/net/macvlan.c:281 macvlan_queue_xmit drivers/net/macvlan.c:524 [inline] macvlan_start_xmit+0x408/0x785 drivers/net/macvlan.c:563 __netdev_start_xmit include/linux/netdevice.h:4308 [inline] netdev_start_xmit include/linux/netdevice.h:4317 [inline] dev_direct_xmit+0x34d/0x650 net/core/dev.c:3909 packet_direct_xmit+0xf9/0x170 net/packet/af_packet.c:246 packet_snd net/packet/af_packet.c:2958 [inline] packet_sendmsg+0x3bb2/0x6440 net/packet/af_packet.c:2983 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:632 __sys_sendto+0x262/0x380 net/socket.c:1787 __do_sys_sendto net/socket.c:1799 [inline] __se_sys_sendto net/socket.c:1795 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1795 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45af49 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f4b04802c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 000000000045af49 RDX: 000000000000000e RSI: 0000000020000080 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f4b048036d4 R13: 00000000004ca8a7 R14: 00000000004e3ac0 R15: 00000000ffffffff Allocated by task 7949: 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 __do_kmalloc mm/slab.c:3727 [inline] __kmalloc_track_caller+0x159/0x750 mm/slab.c:3742 kstrdup+0x3a/0x70 mm/util.c:56 security_netlbl_sid_to_secattr+0x156/0x2b0 security/selinux/ss/services.c:3678 selinux_netlbl_sock_genattr+0xf3/0x430 security/selinux/netlabel.c:93 selinux_netlbl_socket_post_create+0x7a/0x150 security/selinux/netlabel.c:412 selinux_socket_post_create+0x528/0x830 security/selinux/hooks.c:4628 security_socket_post_create+0x83/0xd0 security/security.c:1385 __sock_create+0x5b1/0x730 net/socket.c:1292 sock_create net/socket.c:1316 [inline] __sys_socket+0x103/0x220 net/socket.c:1346 __do_sys_socket net/socket.c:1355 [inline] __se_sys_socket net/socket.c:1353 [inline] __x64_sys_socket+0x73/0xb0 net/socket.c:1353 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7949: 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:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 netlbl_secattr_destroy include/net/netlabel.h:378 [inline] netlbl_secattr_free include/net/netlabel.h:409 [inline] selinux_netlbl_sk_security_free+0x244/0x310 security/selinux/netlabel.c:171 selinux_sk_free_security+0x47/0x60 security/selinux/hooks.c:5220 security_sk_free+0x41/0x80 security/security.c:1478 sk_prot_free net/core/sock.c:1499 [inline] __sk_destruct+0x477/0x780 net/core/sock.c:1583 sk_destruct+0xc8/0x100 net/core/sock.c:1598 __sk_free+0xce/0x300 net/core/sock.c:1609 sk_free+0x45/0x50 net/core/sock.c:1620 sock_put include/net/sock.h:1707 [inline] tcp_close+0xbb4/0x10a0 net/ipv4/tcp.c:2495 inet_release+0xff/0x1e0 net/ipv4/af_inet.c:428 __sock_release+0xce/0x2a0 net/socket.c:579 sock_close+0x1b/0x30 net/socket.c:1140 __fput+0x2dd/0x8b0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x53d/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808d201500 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 1 bytes inside of 32-byte region [ffff88808d201500, ffff88808d201520) The buggy address belongs to the page: page:ffffea0002348040 count:1 mapcount:0 mapping:ffff88812c31c1c0 index:0xffff88808d201fc1 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea000294df08 ffffea00027f8f48 ffff88812c31c1c0 raw: ffff88808d201fc1 ffff88808d201000 000000010000003e 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808d201400: 00 00 01 fc fc fc fc fc 05 fc fc fc fc fc fc fc ffff88808d201480: 00 01 fc fc fc fc fc fc fb fb fb fb fc fc fc fc >ffff88808d201500: fb fb fb fb fc fc fc fc 00 fc fc fc fc fc fc fc ^ ffff88808d201580: 00 00 00 fc fc fc fc fc 05 fc fc fc fc fc fc fc ffff88808d201600: 00 00 00 fc fc fc fc fc 00 01 fc fc fc fc fc fc ==================================================================