audit: type=1804 audit(1642526271.081:318): pid=32507 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.4" name="/root/syzkaller-testdir884894509/syzkaller.svdCDK/161/file0/bus" dev="loop4" ino=18 res=1 ================================================================== BUG: KASAN: use-after-free in packet_rcv+0x5aa/0x1490 net/packet/af_packet.c:2104 Read of size 1 at addr ffff8880936ef02c by task syz-executor.4/32507 CPU: 1 PID: 32507 Comm: syz-executor.4 Not tainted 4.19.211-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+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load1_noabort+0x88/0x90 mm/kasan/report.c:430 packet_rcv+0x5aa/0x1490 net/packet/af_packet.c:2104 deliver_skb net/core/dev.c:1956 [inline] dev_queue_xmit_nit+0x24d/0xa20 net/core/dev.c:2012 xmit_one net/core/dev.c:3252 [inline] dev_hard_start_xmit+0xaa/0x920 net/core/dev.c:3272 __dev_queue_xmit+0x269d/0x2e00 net/core/dev.c:3838 hsr_xmit net/hsr/hsr_forward.c:237 [inline] hsr_forward_do net/hsr/hsr_forward.c:295 [inline] hsr_forward_skb+0xd2d/0x1c30 net/hsr/hsr_forward.c:373 send_hsr_supervision_frame+0x917/0xf70 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:1338 expire_timers+0x243/0x4e0 kernel/time/timer.c:1375 __run_timers kernel/time/timer.c:1696 [inline] run_timer_softirq+0x21c/0x670 kernel/time/timer.c:1709 x_tables: ip6_tables: TCPOPTSTRIP target: only valid in mangle table, not raw __do_softirq+0x265/0x980 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x215/0x260 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1098 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894 RIP: 0010:__read_once_size include/linux/compiler.h:263 [inline] RIP: 0010:__rcu_read_unlock+0xcc/0x160 kernel/rcu/tree_plugin.h:427 Code: 8c 00 00 00 c7 83 70 03 00 00 00 00 00 80 48 8d bb 74 03 00 00 48 b8 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 RSP: 0018:ffff8880543d6e90 EFLAGS: 00000a03 ORIG_RAX: ffffffffffffff13 RAX: dffffc0000000000 RBX: ffff88805064e180 RCX: ffffc9000864b000 RDX: 0000000000000000 RSI: ffffffff81d8dcae RDI: ffff88805064e4f4 RBP: ffff88805064e4f0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 000000006a77feaa R12: 0000000000000029 R13: 0000000000000001 R14: ffff88809cd71400 R15: 0000000000000000 rcu_read_unlock include/linux/rcupdate.h:680 [inline] ext4_inode_block_valid+0x433/0x6a0 fs/ext4/block_validity.c:342 __check_block_validity.constprop.0+0x193/0x2f0 fs/ext4/inode.c:424 ext4_map_blocks+0xa9e/0x1a50 fs/ext4/inode.c:739 _ext4_get_block+0x208/0x530 fs/ext4/inode.c:810 ext4_get_block_trans+0x165/0x290 fs/ext4/inode.c:871 ext4_dio_get_block+0x73/0xc0 fs/ext4/inode.c:888 get_more_blocks fs/direct-io.c:717 [inline] do_direct_IO fs/direct-io.c:1003 [inline] do_blockdev_direct_IO fs/direct-io.c:1333 [inline] __blockdev_direct_IO+0x424b/0xef40 fs/direct-io.c:1419 ext4_direct_IO_write fs/ext4/inode.c:3777 [inline] ext4_direct_IO+0xae4/0x1c50 fs/ext4/inode.c:3915 generic_file_direct_write+0x208/0x4a0 mm/filemap.c:3073 __generic_file_write_iter+0x2d0/0x610 mm/filemap.c:3252 ext4_file_write_iter+0x2fe/0xf20 fs/ext4/file.c:272 call_write_iter include/linux/fs.h:1821 [inline] do_iter_readv_writev+0x668/0x790 fs/read_write.c:681 do_iter_write+0x182/0x5d0 fs/read_write.c:960 vfs_iter_write+0x70/0xa0 fs/read_write.c:973 iter_file_splice_write+0x60d/0xbb0 fs/splice.c:750 do_splice_from fs/splice.c:852 [inline] direct_splice_actor+0x115/0x160 fs/splice.c:1025 splice_direct_to_actor+0x33f/0x8d0 fs/splice.c:980 do_splice_direct+0x1a7/0x270 fs/splice.c:1068 do_sendfile+0x550/0xc30 fs/read_write.c:1447 __do_sys_sendfile64 fs/read_write.c:1508 [inline] __se_sys_sendfile64+0x147/0x160 fs/read_write.c:1494 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fdfdf72cfe9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdfde0a2168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007fdfdf83ff60 RCX: 00007fdfdf72cfe9 RDX: 0000000000000000 RSI: 0000000000000014 RDI: 0000000000000004 RBP: 00007fdfdf78708d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000080000009 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcf65e135f R14: 00007fdfde0a2300 R15: 0000000000022000 Allocated by task 32542: __do_kmalloc mm/slab.c:3727 [inline] __kmalloc+0x15a/0x3c0 mm/slab.c:3736 kmalloc include/linux/slab.h:520 [inline] sk_prot_alloc+0x1e2/0x2d0 net/core/sock.c:1483 sk_alloc+0x36/0xec0 net/core/sock.c:1537 packet_create+0x117/0x850 net/packet/af_packet.c:3259 __sock_create+0x3d8/0x740 net/socket.c:1365 sock_create net/socket.c:1416 [inline] __sys_socket+0xef/0x200 net/socket.c:1458 __do_sys_socket net/socket.c:1467 [inline] __se_sys_socket net/socket.c:1465 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1465 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 32542: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 sk_prot_free net/core/sock.c:1520 [inline] __sk_destruct+0x684/0x8a0 net/core/sock.c:1602 sk_destruct net/core/sock.c:1617 [inline] __sk_free+0x165/0x3b0 net/core/sock.c:1628 sk_free+0x3b/0x50 net/core/sock.c:1639 sock_put include/net/sock.h:1713 [inline] packet_release+0x890/0xb70 net/packet/af_packet.c:3088 __sock_release+0xcd/0x2a0 net/socket.c:599 sock_close+0x15/0x20 net/socket.c:1214 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xbf3/0x2be0 kernel/exit.c:870 do_group_exit+0x125/0x310 kernel/exit.c:967 get_signal+0x3f2/0x1f70 kernel/signal.c:2589 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799 exit_to_usermode_loop+0x204/0x2a0 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 The buggy address belongs to the object at ffff8880936ee900 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 1836 bytes inside of 4096-byte region [ffff8880936ee900, ffff8880936ef900) The buggy address belongs to the page: page:ffffea00024dbb80 count:1 mapcount:0 mapping:ffff88813bff0dc0 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0002a72a08 ffffea0002802a88 ffff88813bff0dc0 raw: 0000000000000000 ffff8880936ee900 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880936eef00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880936eef80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880936ef000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880936ef080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880936ef100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 8c 00 mov %es,(%rax) 2: 00 00 add %al,(%rax) 4: c7 83 70 03 00 00 00 movl $0x80000000,0x370(%rbx) b: 00 00 80 e: 48 8d bb 74 03 00 00 lea 0x374(%rbx),%rdi 15: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 1c: fc ff df 1f: 48 89 fa mov %rdi,%rdx 22: 48 c1 ea 03 shr $0x3,%rdx 26: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx * 2a: 48 89 f8 mov %rdi,%rax <-- trapping instruction 2d: 83 e0 07 and $0x7,%eax 30: 83 c0 03 add $0x3,%eax 33: 38 d0 cmp %dl,%al 35: 7c 04 jl 0x3b 37: 84 d2 test %dl,%dl 39: 75 62 jne 0x9d 3b: 8b .byte 0x8b 3c: 83 .byte 0x83 3d: 74 03 je 0x42