================================================================== BUG: KASAN: use-after-free in skb_frag_size include/linux/skbuff.h:330 [inline] BUG: KASAN: use-after-free in __skb_datagram_iter+0x6b8/0x770 net/core/datagram.c:441 Read of size 4 at addr ffff88802c068004 by task syz-fuzzer/8447 CPU: 1 PID: 8447 Comm: syz-fuzzer Not tainted 5.12.0-rc8-next-20210423-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436 skb_frag_size include/linux/skbuff.h:330 [inline] __skb_datagram_iter+0x6b8/0x770 net/core/datagram.c:441 skb_copy_datagram_iter+0x40/0x50 net/core/datagram.c:533 skb_copy_datagram_msg include/linux/skbuff.h:3602 [inline] tcp_recvmsg_locked+0x1048/0x22f0 net/ipv4/tcp.c:2472 tcp_recvmsg+0x134/0x550 net/ipv4/tcp.c:2550 inet_recvmsg+0x11b/0x5e0 net/ipv4/af_inet.c:852 sock_recvmsg_nosec net/socket.c:888 [inline] sock_recvmsg net/socket.c:906 [inline] sock_recvmsg net/socket.c:902 [inline] sock_read_iter+0x33c/0x470 net/socket.c:979 call_read_iter include/linux/fs.h:2108 [inline] new_sync_read+0x5b7/0x6e0 fs/read_write.c:415 vfs_read+0x35c/0x570 fs/read_write.c:496 ksys_read+0x1ee/0x250 fs/read_write.c:634 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4af19b Code: fb ff eb bd e8 a6 b6 fb ff e9 61 ff ff ff cc e8 9b 82 fb ff 48 8b 7c 24 10 48 8b 74 24 18 48 8b 54 24 20 48 8b 44 24 08 0f 05 <48> 3d 01 f0 ff ff 76 20 48 c7 44 24 28 ff ff ff ff 48 c7 44 24 30 RSP: 002b:000000c00003b828 EFLAGS: 00000212 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 000000c00001c000 RCX: 00000000004af19b RDX: 0000000000001000 RSI: 000000c0001ec000 RDI: 0000000000000006 RBP: 000000c00003b878 R08: 0000000000000001 R09: 0000000000000002 R10: 0000000000004478 R11: 0000000000000212 R12: ffffffffffffffff R13: 0000000000002000 R14: 0000000000000040 R15: 0000000000000020 Allocated by task 8453: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:428 [inline] ____kasan_kmalloc mm/kasan/common.c:507 [inline] ____kasan_kmalloc mm/kasan/common.c:466 [inline] __kasan_kmalloc+0x9b/0xd0 mm/kasan/common.c:516 kmalloc include/linux/slab.h:558 [inline] tomoyo_print_header security/tomoyo/audit.c:156 [inline] tomoyo_init_log+0x18a/0x1ec0 security/tomoyo/audit.c:255 tomoyo_supervisor+0x34d/0xf00 security/tomoyo/common.c:2097 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x270/0x3a0 security/tomoyo/file.c:573 tomoyo_check_open_permission+0x30f/0x380 security/tomoyo/file.c:780 tomoyo_file_open security/tomoyo/tomoyo.c:313 [inline] tomoyo_file_open+0xa3/0xd0 security/tomoyo/tomoyo.c:308 security_file_open+0x52/0x4f0 security/security.c:1633 do_dentry_open+0x358/0x11b0 fs/open.c:813 do_open fs/namei.c:3361 [inline] path_openat+0x1c09/0x27d0 fs/namei.c:3494 do_filp_open+0x190/0x3d0 fs/namei.c:3521 do_sys_openat2+0x16d/0x420 fs/open.c:1187 do_sys_open fs/open.c:1203 [inline] __do_sys_openat fs/open.c:1219 [inline] __se_sys_openat fs/open.c:1214 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1214 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 11278: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free mm/kasan/common.c:325 [inline] __kasan_slab_free+0xfb/0x130 mm/kasan/common.c:368 kasan_slab_free include/linux/kasan.h:212 [inline] slab_free_hook mm/slub.c:1593 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1618 slab_free mm/slub.c:3178 [inline] kfree+0xe5/0x7f0 mm/slub.c:4245 tomoyo_init_log+0x13eb/0x1ec0 security/tomoyo/audit.c:294 tomoyo_supervisor+0x34d/0xf00 security/tomoyo/common.c:2097 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x270/0x3a0 security/tomoyo/file.c:573 tomoyo_check_open_permission+0x30f/0x380 security/tomoyo/file.c:780 tomoyo_file_open security/tomoyo/tomoyo.c:313 [inline] tomoyo_file_open+0xa3/0xd0 security/tomoyo/tomoyo.c:308 security_file_open+0x52/0x4f0 security/security.c:1633 do_dentry_open+0x358/0x11b0 fs/open.c:813 do_open fs/namei.c:3361 [inline] path_openat+0x1c09/0x27d0 fs/namei.c:3494 do_filp_open+0x190/0x3d0 fs/namei.c:3521 do_sys_openat2+0x16d/0x420 fs/open.c:1187 do_sys_open fs/open.c:1203 [inline] __do_sys_openat fs/open.c:1219 [inline] __se_sys_openat fs/open.c:1214 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1214 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88802c068000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 4 bytes inside of 4096-byte region [ffff88802c068000, ffff88802c069000) The buggy address belongs to the page: page:ffffea0000b01a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802c06a000 pfn:0x2c068 head:ffffea0000b01a00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea000080f008 ffffea00006b7208 ffff888011042140 raw: ffff88802c06a000 0000000000040003 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88802c067f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802c067f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802c068000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802c068080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802c068100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================