================================================================== BUG: KASAN: slab-out-of-bounds in sg_assign_page include/linux/scatterlist.h:131 [inline] BUG: KASAN: slab-out-of-bounds in sg_set_page include/linux/scatterlist.h:162 [inline] BUG: KASAN: slab-out-of-bounds in af_alg_pull_tsgl+0x8fb/0xa80 crypto/af_alg.c:711 Read of size 8 at addr ffff88805adf6360 by task syz.3.1413/10509 CPU: 3 UID: 0 PID: 10509 Comm: syz.3.1413 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x156/0x4c9 mm/kasan/report.c:482 kasan_report+0xdf/0x1e0 mm/kasan/report.c:595 sg_assign_page include/linux/scatterlist.h:131 [inline] sg_set_page include/linux/scatterlist.h:162 [inline] af_alg_pull_tsgl+0x8fb/0xa80 crypto/af_alg.c:711 _skcipher_recvmsg crypto/algif_skcipher.c:152 [inline] skcipher_recvmsg+0x512/0x1020 crypto/algif_skcipher.c:221 sock_recvmsg_nosec net/socket.c:1078 [inline] sock_recvmsg+0x1a4/0x1f0 net/socket.c:1100 __sys_recvfrom+0x200/0x300 net/socket.c:2256 __do_sys_recvfrom net/socket.c:2271 [inline] __se_sys_recvfrom net/socket.c:2267 [inline] __x64_sys_recvfrom+0xe0/0x1c0 net/socket.c:2267 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb94e35d04e Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08 RSP: 002b:00007fb94f2dde88 EFLAGS: 00000246 ORIG_RAX: 000000000000002d RAX: ffffffffffffffda RBX: 00007fb94f2df6c0 RCX: 00007fb94e35d04e RDX: 0000000000001000 RSI: 00007fb94f2de000 RDI: 0000000000000007 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000007 R13: 00007fb94f2ddf58 R14: 00007fb94f2de000 R15: 0000000000000000 Allocated by task 10509: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5260 [inline] __kmalloc_noprof+0x301/0x850 mm/slub.c:5272 kmalloc_noprof include/linux/slab.h:954 [inline] sock_kmalloc+0x111/0x170 net/core/sock.c:2880 _skcipher_recvmsg crypto/algif_skcipher.c:144 [inline] skcipher_recvmsg+0x48b/0x1020 crypto/algif_skcipher.c:221 sock_recvmsg_nosec net/socket.c:1078 [inline] sock_recvmsg+0x1a4/0x1f0 net/socket.c:1100 __sys_recvfrom+0x200/0x300 net/socket.c:2256 __do_sys_recvfrom net/socket.c:2271 [inline] __se_sys_recvfrom net/socket.c:2267 [inline] __x64_sys_recvfrom+0xe0/0x1c0 net/socket.c:2267 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88805adf6340 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes to the right of allocated 32-byte region [ffff88805adf6340, ffff88805adf6360) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5adf6 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801b842780 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800400040 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 7178, tgid 7177 (syz.0.346), ts 93722680422, free_ts 90380203766 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x153/0x170 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x111d/0x3140 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x27c/0x2ba0 mm/page_alloc.c:5250 alloc_slab_page mm/slub.c:3292 [inline] allocate_slab mm/slub.c:3481 [inline] new_slab+0xa6/0x6b0 mm/slub.c:3539 refill_objects+0x26b/0x400 mm/slub.c:7175 refill_sheaf mm/slub.c:2812 [inline] __pcs_replace_empty_main+0x1ab/0x660 mm/slub.c:4615 alloc_from_pcs mm/slub.c:4717 [inline] slab_alloc_node mm/slub.c:4851 [inline] __kmalloc_cache_noprof+0x493/0x6f0 mm/slub.c:5375 kmalloc_noprof include/linux/slab.h:950 [inline] kzalloc_noprof include/linux/slab.h:1188 [inline] ref_tracker_alloc+0x190/0x590 lib/ref_tracker.c:270 __netdev_tracker_alloc include/linux/netdevice.h:4436 [inline] netdev_hold include/linux/netdevice.h:4465 [inline] dst_init+0xda/0x5b0 net/core/dst.c:52 dst_alloc+0xbb/0x1a0 net/core/dst.c:94 rt_dst_clone+0x5a/0x860 net/ipv4/route.c:1679 ip_mc_finish_output+0x99/0x340 net/ipv4/ip_output.c:357 NF_HOOK include/linux/netfilter.h:318 [inline] NF_HOOK include/linux/netfilter.h:312 [inline] ip_mc_output+0x76f/0xd70 net/ipv4/ip_output.c:417 dst_output include/net/dst.h:470 [inline] ip_local_out+0x1ad/0x1f0 net/ipv4/ip_output.c:131 __ip_queue_xmit+0x885/0x1e90 net/ipv4/ip_output.c:534 l2tp_xmit_queue net/l2tp/l2tp_core.c:1219 [inline] l2tp_xmit_core net/l2tp/l2tp_core.c:1311 [inline] l2tp_xmit_skb+0x825/0x1b00 net/l2tp/l2tp_core.c:1327 page last free pid 5946 tgid 5946 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0x7e1/0x10d0 mm/page_alloc.c:2978 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xe0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4538 [inline] slab_alloc_node mm/slub.c:4866 [inline] __do_kmalloc_node mm/slub.c:5259 [inline] __kvmalloc_node_noprof+0x316/0xa00 mm/slub.c:6752 simple_xattr_alloc+0x4a/0xa0 fs/xattr.c:1221 simple_xattr_set+0x3d/0x3e0 fs/xattr.c:1341 shmem_xattr_handler_set+0x318/0x3b0 mm/shmem.c:4347 __vfs_setxattr+0x175/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x127/0x2b0 fs/xattr.c:295 vfs_setxattr+0x14a/0x390 fs/xattr.c:321 do_setxattr+0x145/0x180 fs/xattr.c:636 filename_setxattr+0x167/0x1d0 fs/xattr.c:664 path_setxattrat+0x1ff/0x3b0 fs/xattr.c:708 __do_sys_lsetxattr fs/xattr.c:749 [inline] __se_sys_lsetxattr fs/xattr.c:745 [inline] __x64_sys_lsetxattr+0xc9/0x140 fs/xattr.c:745 Memory state around the buggy address: ffff88805adf6200: fa fb fb fb fc fc fc fc 00 00 00 00 fc fc fc fc ffff88805adf6280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc >ffff88805adf6300: fa fb fb fb fc fc fc fc 00 00 00 00 fc fc fc fc ^ ffff88805adf6380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff88805adf6400: 00 00 00 00 fc fc fc fc fa fb fb fb fc fc fc fc ==================================================================