audit: type=1804 audit(1585775517.633:132): pid=11840 uid=0 auid=4294967295 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir579003096/syzkaller.MD7owu/125/file0/file0" dev="ramfs" ino=45734 res=1 ================================================================== BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:193 [inline] BUG: KASAN: use-after-free in dev_queue_xmit_nit+0x87a/0xa00 net/core/dev.c:2008 Read of size 8 at addr ffff8880a87e4830 by task syz-executor.5/11810 CPU: 1 PID: 11810 Comm: syz-executor.5 Not tainted 4.19.113-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+0x188/0x20d lib/dump_stack.c:118 print_address_description.cold+0x7c/0x212 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+0x88/0x2b9 mm/kasan/report.c:396 __read_once_size include/linux/compiler.h:193 [inline] dev_queue_xmit_nit+0x87a/0xa00 net/core/dev.c:2008 xmit_one net/core/dev.c:3254 [inline] dev_hard_start_xmit+0xa6/0x950 net/core/dev.c:3274 __dev_queue_xmit+0x270f/0x3040 net/core/dev.c:3844 hsr_xmit net/hsr/hsr_forward.c:237 [inline] hsr_forward_do net/hsr/hsr_forward.c:295 [inline] hsr_forward_skb+0xcf7/0x1bb0 net/hsr/hsr_forward.c:373 send_hsr_supervision_frame+0x920/0xfb0 net/hsr/hsr_device.c:321 hsr_announce+0x125/0x3a0 net/hsr/hsr_device.c:350 call_timer_fn+0x177/0x700 kernel/time/timer.c:1326 expire_timers kernel/time/timer.c:1363 [inline] __run_timers kernel/time/timer.c:1684 [inline] __run_timers kernel/time/timer.c:1652 [inline] run_timer_softirq+0x5d0/0x1540 kernel/time/timer.c:1697 __do_softirq+0x26c/0x93c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x17b/0x1c0 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:544 [inline] smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1094 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:893 RIP: 0010:__rcu_read_unlock+0xe3/0x160 kernel/rcu/tree_plugin.h:427 Code: 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 62 8b 83 74 03 00 00 <85> c0 75 69 48 b8 00 00 00 00 00 fc ff df 48 89 ea 48 c1 ea 03 0f RSP: 0018:ffff888086c1f6f8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: ffff88803eb82640 RCX: ffffffff81567a3c RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff88803eb829b4 RBP: ffff88803eb829b0 R08: ffff88803eb82640 R09: ffffed1015ce4733 R10: ffffed1015ce4732 R11: ffff8880ae723993 R12: ffffea0001455c08 R13: 0000000000000000 R14: 0000000000000000 R15: dead000000000100 rcu_read_unlock include/linux/rcupdate.h:680 [inline] __unlock_page_memcg+0x54/0x100 mm/memcontrol.c:1955 page_remove_file_rmap mm/rmap.c:1249 [inline] page_remove_rmap+0x55e/0x1260 mm/rmap.c:1300 zap_pte_range mm/memory.c:1338 [inline] zap_pmd_range mm/memory.c:1440 [inline] zap_pud_range mm/memory.c:1469 [inline] zap_p4d_range mm/memory.c:1490 [inline] unmap_page_range+0xcec/0x1de0 mm/memory.c:1511 unmap_single_vma+0x196/0x300 mm/memory.c:1556 unmap_vmas+0xa9/0x180 mm/memory.c:1586 exit_mmap+0x2b2/0x510 mm/mmap.c:3091 __mmput kernel/fork.c:1015 [inline] mmput+0x14e/0x4a0 kernel/fork.c:1036 exit_mm kernel/exit.c:546 [inline] do_exit+0xac8/0x2f30 kernel/exit.c:867 do_group_exit+0x125/0x350 kernel/exit.c:983 get_signal+0x3ec/0x1f90 kernel/signal.c:2588 do_signal+0x8f/0x1710 arch/x86/kernel/signal.c:821 exit_to_usermode_loop+0x22b/0x2b0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c849 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:00007fafdb37ec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffed RBX: 00007fafdb37f6d4 RCX: 000000000045c849 RDX: 0000000020000080 RSI: 000000000000890b RDI: 0000000000000009 RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000006ae R14: 00000000004c968e R15: 000000000076bf0c Allocated by task 11832: set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xbf/0xe0 mm/kasan/kasan.c:531 __do_kmalloc mm/slab.c:3727 [inline] __kmalloc+0x15b/0x770 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] sk_prot_alloc+0x18c/0x2d0 net/core/sock.c:1466 sk_alloc+0x36/0xf50 net/core/sock.c:1520 packet_create+0x115/0x840 net/packet/af_packet.c:3236 __sock_create+0x3d5/0x740 net/socket.c:1276 sock_create net/socket.c:1316 [inline] __sys_socket+0xef/0x200 net/socket.c:1346 __do_sys_socket net/socket.c:1355 [inline] __se_sys_socket net/socket.c:1353 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1353 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 11807: set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/kasan.c:521 __cache_free mm/slab.c:3503 [inline] kfree+0xce/0x220 mm/slab.c:3822 sk_prot_free net/core/sock.c:1503 [inline] __sk_destruct+0x579/0x780 net/core/sock.c:1583 sk_destruct+0xb9/0xf0 net/core/sock.c:1598 __sk_free+0xc2/0x2e0 net/core/sock.c:1609 sk_free+0x3b/0x50 net/core/sock.c:1620 sock_put include/net/sock.h:1707 [inline] packet_release+0x93f/0xc70 net/packet/af_packet.c:3065 __sock_release+0xcd/0x2a0 net/socket.c:579 sock_close+0x15/0x20 net/socket.c:1140 __fput+0x2cd/0x890 fs/file_table.c:278 task_work_run+0x13f/0x1b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x25a/0x2b0 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+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a87e4040 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 2032 bytes inside of 2048-byte region [ffff8880a87e4040, ffff8880a87e4840) The buggy address belongs to the page: page:ffffea0002a1f900 count:1 mapcount:0 mapping:ffff88812c3dcc40 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffffea000293af88 ffffea000283fc88 ffff88812c3dcc40 raw: 0000000000000000 ffff8880a87e4040 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a87e4700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a87e4780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a87e4800: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880a87e4880: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8880a87e4900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================