loop0: detected capacity change from 0 to 1024 ======================================================= WARNING: The mand mount option has been deprecated and and is ignored by this kernel. Remove the mand option from the mount to silence this warning. ======================================================= EXT4-fs: Ignoring removed bh option EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: writeback. ================================================================== BUG: KASAN: slab-out-of-bounds in ext4_xattr_set_entry+0x17ab/0x1e20 fs/ext4/xattr.c:1736 Write of size 196760 at addr ffff88803fa86000 by task syz.0.0/5320 CPU: 0 UID: 0 PID: 5320 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:200 __asan_memset+0x22/0x50 mm/kasan/shadow.c:84 ext4_xattr_set_entry+0x17ab/0x1e20 fs/ext4/xattr.c:1736 ext4_xattr_block_set+0x872/0x2ac0 fs/ext4/xattr.c:2025 ext4_xattr_set_handle+0xdfb/0x1590 fs/ext4/xattr.c:2452 ext4_xattr_set+0x230/0x320 fs/ext4/xattr.c:2554 __vfs_setxattr+0x43c/0x480 fs/xattr.c:200 __vfs_setxattr_noperm+0x12d/0x660 fs/xattr.c:234 vfs_setxattr+0x16b/0x2f0 fs/xattr.c:321 do_setxattr fs/xattr.c:636 [inline] filename_setxattr+0x274/0x600 fs/xattr.c:665 path_setxattrat+0x364/0x3a0 fs/xattr.c:713 __do_sys_lsetxattr fs/xattr.c:754 [inline] __se_sys_lsetxattr fs/xattr.c:750 [inline] __x64_sys_lsetxattr+0xbf/0xe0 fs/xattr.c:750 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f052c78f6c9 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:00007f052d70d038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f052c9e5fa0 RCX: 00007f052c78f6c9 RDX: 0000200000000480 RSI: 00002000000000c0 RDI: 0000200000000100 RBP: 00007f052c811f91 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000fe37 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f052c9e6038 R14: 00007f052c9e5fa0 R15: 00007ffdb16fd358 Allocated by task 5320: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5650 [inline] __kmalloc_node_track_caller_noprof+0x568/0x800 mm/slub.c:5759 kmemdup_noprof+0x2b/0x70 mm/util.c:138 kmemdup_noprof include/linux/fortify-string.h:765 [inline] ext4_xattr_block_set+0x781/0x2ac0 fs/ext4/xattr.c:1973 ext4_xattr_set_handle+0xdfb/0x1590 fs/ext4/xattr.c:2452 ext4_xattr_set+0x230/0x320 fs/ext4/xattr.c:2554 __vfs_setxattr+0x43c/0x480 fs/xattr.c:200 __vfs_setxattr_noperm+0x12d/0x660 fs/xattr.c:234 vfs_setxattr+0x16b/0x2f0 fs/xattr.c:321 do_setxattr fs/xattr.c:636 [inline] filename_setxattr+0x274/0x600 fs/xattr.c:665 path_setxattrat+0x364/0x3a0 fs/xattr.c:713 __do_sys_lsetxattr fs/xattr.c:754 [inline] __se_sys_lsetxattr fs/xattr.c:750 [inline] __x64_sys_lsetxattr+0xbf/0xe0 fs/xattr.c:750 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88803fa86000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 0 bytes inside of allocated 1024-byte region [ffff88803fa86000, ffff88803fa86400) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3fa84 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801a041dc0 ffffea0000ff4500 dead000000000003 raw: 0000000000000000 0000000080080008 00000000f5000000 0000000000000000 head: 04fff00000000040 ffff88801a041dc0 ffffea0000ff4500 dead000000000003 head: 0000000000000000 0000000080080008 00000000f5000000 0000000000000000 head: 04fff00000000002 ffffea0000fea101 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 26543605393, free_ts 26537851744 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3059 [inline] allocate_slab+0x96/0x350 mm/slub.c:3232 new_slab mm/slub.c:3286 [inline] ___slab_alloc+0xf56/0x1990 mm/slub.c:4655 __slab_alloc+0x65/0x100 mm/slub.c:4778 __slab_alloc_node mm/slub.c:4854 [inline] slab_alloc_node mm/slub.c:5276 [inline] __do_kmalloc_node mm/slub.c:5649 [inline] __kmalloc_noprof+0x471/0x7f0 mm/slub.c:5662 mpi_powm+0x1186/0x23c0 lib/crypto/mpi/mpi-pow.c:157 _rsa_enc crypto/rsa.c:62 [inline] rsa_enc+0x300/0x440 crypto/rsa.c:141 crypto_akcipher_encrypt include/crypto/akcipher.h:279 [inline] rsassa_pkcs1_verify+0x4ed/0xb00 crypto/rsassa-pkcs1.c:255 crypto_sig_verify include/crypto/sig.h:221 [inline] public_key_verify_signature+0x678/0x8f0 crypto/asymmetric_keys/public_key.c:428 x509_check_for_self_signed+0x327/0x430 crypto/asymmetric_keys/x509_public_key.c:125 x509_cert_parse+0x63d/0x7b0 crypto/asymmetric_keys/x509_cert_parser.c:129 x509_key_preparse+0x64/0x780 crypto/asymmetric_keys/x509_public_key.c:157 asymmetric_key_preparse+0xb3/0x160 crypto/asymmetric_keys/asymmetric_type.c:408 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 stack_depot_save_flags+0x436/0x860 lib/stackdepot.c:727 kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x4f/0x80 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __do_kmalloc_node mm/slub.c:5650 [inline] __kmalloc_noprof+0x411/0x7f0 mm/slub.c:5662 kmalloc_noprof include/linux/slab.h:961 [inline] x509_key_preparse+0x223/0x780 crypto/asymmetric_keys/x509_public_key.c:190 asymmetric_key_preparse+0xb3/0x160 crypto/asymmetric_keys/asymmetric_type.c:408 __key_create_or_update+0x370/0xa30 security/keys/key.c:857 key_create_or_update+0x42/0x60 security/keys/key.c:1021 x509_load_certificate_list+0x145/0x280 crypto/asymmetric_keys/x509_loader.c:31 load_builtin_regdb_keys+0xaf/0xe0 net/wireless/reg.c:761 regulatory_init_db+0x30/0x290 net/wireless/reg.c:4278 do_one_initcall+0x236/0x820 init/main.c:1283 do_initcall_level+0x104/0x190 init/main.c:1345 do_initcalls+0x59/0xa0 init/main.c:1361 kernel_init_freeable+0x334/0x4b0 init/main.c:1593 Memory state around the buggy address: ffff88803fa86300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88803fa86380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88803fa86400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88803fa86480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803fa86500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================