syzbot


KASAN: slab-out-of-bounds Read in geneve_xmit

Status: upstream: reported on 2024/10/31 02:05
Reported-by: syzbot+fccc63f24dab91f66125@syzkaller.appspotmail.com
First crash: 33d, last: 25d
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in geneve_xmit net 1 1121d 1121d 0/28 auto-closed as invalid on 2022/02/05 16:18
upstream KMSAN: kernel-infoleak in copyout (2) net C 6723 544d 1712d 22/28 fixed on 2023/06/08 14:41
upstream KMSAN: uninit-value in geneve_xmit (3) net C 14 236d 244d 25/28 fixed on 2024/05/23 00:06
upstream KMSAN: kernel-infoleak in _copy_to_iter (7) net C 138977 648d 1000d 22/28 fixed on 2023/02/24 13:50
linux-4.19 KASAN: use-after-free Read in geneve_xmit 1 806d 806d 0/1 auto-obsoleted due to no activity on 2023/01/16 22:54
upstream KMSAN: uninit-value in geneve_xmit (2) net C 12 256d 334d 25/28 fixed on 2024/03/26 00:54

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in geneve_xmit_skb drivers/net/geneve.c:990 [inline]
BUG: KASAN: slab-out-of-bounds in geneve_xmit+0x332f/0x34a0 drivers/net/geneve.c:1119
Read of size 2 at addr ffff888060cd940b by task syz.1.1280/7673

CPU: 1 PID: 7673 Comm: syz.1.1280 Not tainted 5.15.169-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_address_description+0x63/0x3b0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
 geneve_xmit_skb drivers/net/geneve.c:990 [inline]
 geneve_xmit+0x332f/0x34a0 drivers/net/geneve.c:1119
 __netdev_start_xmit include/linux/netdevice.h:5019 [inline]
 netdev_start_xmit include/linux/netdevice.h:5033 [inline]
 __dev_direct_xmit+0x4d9/0x740 net/core/dev.c:4320
 dev_direct_xmit include/linux/netdevice.h:3001 [inline]
 packet_direct_xmit+0x167/0x2a0 net/packet/af_packet.c:246
 packet_snd net/packet/af_packet.c:3104 [inline]
 packet_sendmsg+0x449d/0x5e90 net/packet/af_packet.c:3135
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2436
 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2490
 __sys_sendmsg net/socket.c:2519 [inline]
 __do_sys_sendmsg net/socket.c:2528 [inline]
 __se_sys_sendmsg+0x19a/0x260 net/socket.c:2526
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f217b7f0719
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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f2179c68038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f217b9a7f80 RCX: 00007f217b7f0719
RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 0000000000000003
RBP: 00007f217b86332e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f217b9a7f80 R15: 00007ffd42a01ef8
 </TASK>

Allocated by task 7544:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247
 kmalloc include/linux/slab.h:591 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 kobject_uevent_env+0x283/0x8d0 lib/kobject_uevent.c:539
 __device_release_driver drivers/base/dd.c:1251 [inline]
 device_release_driver_internal+0x6ff/0x7f0 drivers/base/dd.c:1262
 proc_disconnect_claim drivers/usb/core/devio.c:2478 [inline]
 usbdev_do_ioctl drivers/usb/core/devio.c:2761 [inline]
 usbdev_ioctl+0x4d86/0x6080 drivers/usb/core/devio.c:2805
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 7544:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kfree+0xf1/0x270 mm/slub.c:4559
 kobject_uevent_env+0x36a/0x8d0 lib/kobject_uevent.c:641
 __device_release_driver drivers/base/dd.c:1251 [inline]
 device_release_driver_internal+0x6ff/0x7f0 drivers/base/dd.c:1262
 proc_disconnect_claim drivers/usb/core/devio.c:2478 [inline]
 usbdev_do_ioctl drivers/usb/core/devio.c:2761 [inline]
 usbdev_ioctl+0x4d86/0x6080 drivers/usb/core/devio.c:2805
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff888060cd8000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 1035 bytes to the right of
 4096-byte region [ffff888060cd8000, ffff888060cd9000)
The buggy address belongs to the page:
page:ffffea0001833600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x60cd8
head:ffffea0001833600 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 0000000200000001 ffff888017042140
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3544, ts 100068925346, free_ts 99976243750
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159
 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423
 alloc_slab_page mm/slub.c:1775 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xbb/0x4b0 mm/slub.c:1975
 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
 __slab_alloc mm/slub.c:3095 [inline]
 slab_alloc_node mm/slub.c:3186 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 __kmalloc+0x1c9/0x300 mm/slub.c:4403
 kmalloc include/linux/slab.h:596 [inline]
 tomoyo_realpath_from_path+0xd8/0x5e0 security/tomoyo/realpath.c:254
 tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
 tomoyo_path_perm+0x273/0x6b0 security/tomoyo/file.c:822
 security_inode_getattr+0xcf/0x120 security/security.c:1348
 vfs_getattr+0x26/0x360 fs/stat.c:157
 vfs_statx+0x18f/0x3b0 fs/stat.c:225
 vfs_fstatat fs/stat.c:243 [inline]
 __do_sys_newfstatat fs/stat.c:411 [inline]
 __se_sys_newfstatat fs/stat.c:405 [inline]
 __x64_sys_newfstatat+0x12c/0x1b0 fs/stat.c:405
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317
 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
 free_slab mm/slub.c:2015 [inline]
 discard_slab mm/slub.c:2021 [inline]
 __unfreeze_partials+0x1b7/0x210 mm/slub.c:2507
 put_cpu_partial+0x132/0x1a0 mm/slub.c:2587
 do_slab_free mm/slub.c:3487 [inline]
 ___cache_free+0xe3/0x100 mm/slub.c:3506
 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 __kmalloc+0x120/0x300 mm/slub.c:4403
 kmalloc include/linux/slab.h:596 [inline]
 tomoyo_realpath_from_path+0xd8/0x5e0 security/tomoyo/realpath.c:254
 tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
 tomoyo_path_number_perm+0x225/0x810 security/tomoyo/file.c:723
 security_file_ioctl+0x6d/0xa0 security/security.c:1555
 __do_sys_ioctl fs/ioctl.c:868 [inline]
 __se_sys_ioctl+0x47/0x160 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
 ffff888060cd9300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888060cd9380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888060cd9400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                      ^
 ffff888060cd9480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888060cd9500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/31 02:05 linux-5.15.y 74cdd62cb470 96eb609f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in geneve_xmit
2024/11/07 13:16 linux-5.15.y 72244eab0dad 867e44df .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in geneve_xmit
2024/11/07 13:16 linux-5.15.y 72244eab0dad 867e44df .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in geneve_xmit
* Struck through repros no longer work on HEAD.