syzbot


KASAN: use-after-free Read in __skb_datagram_iter

Status: auto-closed as invalid on 2021/07/03 04:24
Subsystems: net
[Documentation on labels]
First crash: 1157d, last: 1144d
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 KASAN: use-after-free Read in __skb_datagram_iter origin:upstream C done 1 190d 221d 0/2 auto-obsoleted due to no activity on 2024/03/22 20:57
upstream KMSAN: kernel-infoleak in __skb_datagram_iter (2) net C 126 88d 140d 26/27 fixed on 2024/03/25 23:45
upstream KMSAN: kernel-infoleak in __skb_datagram_iter (4) net 27 8d22h 28d 0/27 upstream: reported on 2024/05/24 12:51
upstream KMSAN: kernel-infoleak in copyout (2) net C 6723 379d 1548d 22/27 fixed on 2023/06/08 14:41
upstream KMSAN: kernel-infoleak in __skb_datagram_iter (3) net C 25 32d 86d 26/27 fixed on 2024/05/23 00:06
upstream KMSAN: kernel-infoleak in __skb_datagram_iter net 68 269d 374d 23/27 fixed on 2023/09/28 17:51

Sample crash report:
==================================================================
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 ffff88801d808004 by task syz-fuzzer/8403

CPU: 1 PID: 8403 Comm: syz-fuzzer Not tainted 5.12.0-rc7-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:232
 __kasan_report mm/kasan/report.c:399 [inline]
 kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416
 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/0x5d0 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:1971 [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+0x2d/0x70 arch/x86/entry/common.c:46
 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:000000c0004a3868 EFLAGS: 00000216 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 000000c00001e800 RCX: 00000000004af19b
RDX: 0000000000001000 RSI: 000000c000196000 RDI: 0000000000000006
RBP: 000000c0004a38b8 R08: 0000000000000001 R09: 0000000000000002
R10: 00000000000051f7 R11: 0000000000000216 R12: 00000000000051f2
R13: 0000000000001000 R14: 0000000000000002 R15: 0000000000000002

Allocated by task 8391:
 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:427 [inline]
 ____kasan_kmalloc mm/kasan/common.c:506 [inline]
 ____kasan_kmalloc mm/kasan/common.c:465 [inline]
 __kasan_kmalloc+0x99/0xc0 mm/kasan/common.c:515
 kmalloc include/linux/slab.h:554 [inline]
 tomoyo_print_header security/tomoyo/audit.c:156 [inline]
 tomoyo_init_log+0x18a/0x1ee0 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_path_perm+0x2f0/0x400 security/tomoyo/file.c:838
 security_inode_getattr+0xcf/0x140 security/security.c:1288
 vfs_getattr fs/stat.c:131 [inline]
 vfs_statx+0x164/0x390 fs/stat.c:199
 vfs_fstatat fs/stat.c:217 [inline]
 __do_sys_newfstatat+0x96/0x120 fs/stat.c:386
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Freed by task 8270:
 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+0xf5/0x130 mm/kasan/common.c:367
 kasan_slab_free include/linux/kasan.h:199 [inline]
 slab_free_hook mm/slub.c:1562 [inline]
 slab_free_freelist_hook+0x92/0x210 mm/slub.c:1600
 slab_free mm/slub.c:3161 [inline]
 kfree+0xe5/0x7f0 mm/slub.c:4213
 tomoyo_init_log+0x14f7/0x1ee0 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_path_perm+0x2f0/0x400 security/tomoyo/file.c:838
 security_inode_getattr+0xcf/0x140 security/security.c:1288
 vfs_getattr fs/stat.c:131 [inline]
 vfs_statx+0x164/0x390 fs/stat.c:199
 vfs_fstatat fs/stat.c:217 [inline]
 __do_sys_newfstatat+0x96/0x120 fs/stat.c:386
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xae

The buggy address belongs to the object at ffff88801d808000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 4 bytes inside of
 4096-byte region [ffff88801d808000, ffff88801d809000)
The buggy address belongs to the page:
page:ffffea0000760200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d808
head:ffffea0000760200 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010842140
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88801d807f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88801d807f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88801d808000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff88801d808080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88801d808100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (431):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/04/23 22:23 net-next-old cad4162a90ae 17f0b706 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __skb_datagram_iter
2021/04/23 20:04 net-next-old cad4162a90ae 17f0b706 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __skb_datagram_iter
2021/05/04 04:21 linux-next e3d35712f85a ad61f371 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/04 02:11 linux-next e3d35712f85a ad61f371 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/04 00:25 linux-next e3d35712f85a ad61f371 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/03 21:56 linux-next e3d35712f85a ad61f371 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/03 20:10 linux-next e3d35712f85a ad61f371 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/03 18:38 linux-next e3d35712f85a ad61f371 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/03 16:12 linux-next e3d35712f85a ad61f371 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/03 12:05 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/03 09:41 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/03 08:05 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/03 05:11 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/03 03:44 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/03 02:01 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/03 00:40 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 23:33 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 23:15 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 21:02 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 19:53 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 18:46 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 17:42 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 15:29 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 13:20 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 11:24 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 09:08 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 07:08 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 06:36 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 05:23 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 03:56 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 02:54 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/02 00:34 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 23:15 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 22:02 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 20:49 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 19:25 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 18:17 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 17:59 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 16:32 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 15:09 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 13:32 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 12:18 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 10:56 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/05/01 09:33 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: use-after-free Read in __skb_datagram_iter
2021/04/30 22:53 linux-next e3d35712f85a 77e2b668 .config console log report info ci-upstream-linux-next-kasan-gce-root KASAN: out-of-bounds Read in __skb_datagram_iter
* Struck through repros no longer work on HEAD.