================================================================== BUG: KASAN: slab-out-of-bounds in sg_assign_page include/linux/scatterlist.h:109 [inline] BUG: KASAN: slab-out-of-bounds in sg_set_page include/linux/scatterlist.h:139 [inline] BUG: KASAN: slab-out-of-bounds in extract_bvec_to_sg lib/scatterlist.c:1183 [inline] BUG: KASAN: slab-out-of-bounds in extract_iter_to_sg lib/scatterlist.c:1352 [inline] BUG: KASAN: slab-out-of-bounds in extract_iter_to_sg+0x17a6/0x1960 lib/scatterlist.c:1339 Read of size 8 at addr ffff88807b870ff8 by task syz-executor.4/3401 CPU: 1 PID: 3401 Comm: syz-executor.4 Not tainted 6.4.0-rc6-syzkaller-01304-gc08afcdcf952 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 sg_assign_page include/linux/scatterlist.h:109 [inline] sg_set_page include/linux/scatterlist.h:139 [inline] extract_bvec_to_sg lib/scatterlist.c:1183 [inline] extract_iter_to_sg lib/scatterlist.c:1352 [inline] extract_iter_to_sg+0x17a6/0x1960 lib/scatterlist.c:1339 af_alg_sendmsg+0x1917/0x2990 crypto/af_alg.c:1045 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 splice_to_socket+0x964/0xee0 fs/splice.c:915 do_splice_from fs/splice.c:967 [inline] direct_splice_actor+0x114/0x180 fs/splice.c:1155 splice_direct_to_actor+0x34a/0x9c0 fs/splice.c:1101 do_splice_direct+0x1ad/0x280 fs/splice.c:1207 do_sendfile+0xb19/0x12c0 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64 fs/read_write.c:1308 [inline] __x64_sys_sendfile64+0x1d0/0x210 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f226fa8c389 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f227075b168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f226fbac050 RCX: 00007f226fa8c389 RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000008 RBP: 00007f226fad7493 R08: 0000000000000000 R09: 0000000000000000 R10: 000000010000a006 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffd5e7a7ef R14: 00007f227075b300 R15: 0000000000022000 Allocated by task 3406: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc+0x5e/0x190 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] sock_kmalloc+0xb2/0x100 net/core/sock.c:2678 af_alg_alloc_tsgl crypto/af_alg.c:614 [inline] af_alg_sendmsg+0x17a4/0x2990 crypto/af_alg.c:1028 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 ____sys_sendmsg+0x733/0x920 net/socket.c:2493 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2547 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2576 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88807b870000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 0 bytes to the right of allocated 4088-byte region [ffff88807b870000, ffff88807b870ff8) The buggy address belongs to the physical page: page:ffffea0001ee1c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7b870 head:ffffea0001ee1c00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012442140 dead000000000100 dead000000000122 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 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4462, tgid 4462 (udevd), ts 30422004144, free_ts 23561892786 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf41/0x2c00 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x390 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3192 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0x136/0x320 mm/slub.c:3490 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc+0x4e/0x190 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] tomoyo_realpath_from_path+0xc3/0x600 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path2_perm+0x33e/0x6e0 security/tomoyo/file.c:923 tomoyo_path_rename+0x102/0x1b0 security/tomoyo/tomoyo.c:299 security_path_rename+0x121/0x230 security/security.c:1789 do_renameat2+0x47d/0xd40 fs/namei.c:4989 __do_sys_rename fs/namei.c:5048 [inline] __se_sys_rename fs/namei.c:5046 [inline] __x64_sys_rename+0x81/0xa0 fs/namei.c:5046 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x62e/0xcb0 mm/page_alloc.c:2564 free_unref_page+0x33/0x370 mm/page_alloc.c:2659 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2636 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x195/0x220 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slub.c:3451 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc+0x17c/0x3b0 mm/slub.c:3475 vm_area_dup+0x23/0x300 kernel/fork.c:504 __split_vma+0x199/0x830 mm/mmap.c:2248 do_vmi_align_munmap+0x400/0x1580 mm/mmap.c:2398 do_vmi_munmap+0x26e/0x2c0 mm/mmap.c:2530 mmap_region+0x1f0/0x28d0 mm/mmap.c:2578 do_mmap+0x831/0xf60 mm/mmap.c:1394 vm_mmap_pgoff+0x1a2/0x3b0 mm/util.c:543 ksys_mmap_pgoff+0x41f/0x5a0 mm/mmap.c:1440 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff88807b870e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807b870f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807b870f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc ^ ffff88807b871000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807b871080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================