================================================================== BUG: KASAN: slab-out-of-bounds in smk_access+0xae/0x4e0 security/smack/smack_access.c:147 Read of size 8 at addr ffff88801ac65fa0 by task syz.1.2197/14242 CPU: 1 UID: 0 PID: 14242 Comm: syz.1.2197 Not tainted 6.11.0-syzkaller-07262-g839c4f596f89 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 smk_access+0xae/0x4e0 security/smack/smack_access.c:147 smack_watch_key+0x2f4/0x3a0 security/smack/smack_lsm.c:4656 security_watch_key+0x86/0x250 security/security.c:4448 keyctl_watch_key+0x2b7/0x480 security/keys/keyctl.c:1813 __do_sys_keyctl security/keys/keyctl.c:2021 [inline] __se_sys_keyctl+0x106/0xa50 security/keys/keyctl.c:1874 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f604477def9 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:00007f60441de038 EFLAGS: 00000246 ORIG_RAX: 00000000000000fa RAX: ffffffffffffffda RBX: 00007f6044936058 RCX: 00007f604477def9 RDX: 000000000000000c RSI: 00000000262d9ddf RDI: 0000000000000020 RBP: 00007f60447f0b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f6044936058 R15: 00007ffcbb480b78 Allocated by task 1: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:257 [inline] __do_kmalloc_node mm/slub.c:4265 [inline] __kmalloc_node_track_caller_noprof+0x225/0x440 mm/slub.c:4284 kstrdup+0x3a/0x80 mm/util.c:64 kobject_set_name_vargs+0x61/0x120 lib/kobject.c:274 dev_set_name+0xd5/0x120 drivers/base/core.c:3485 tty_register_device_attr+0x3cc/0x960 drivers/tty/tty_io.c:3275 tty_register_device drivers/tty/tty_io.c:3216 [inline] tty_register_driver+0x5f6/0xc30 drivers/tty/tty_io.c:3479 vty_init+0x1fe/0x300 drivers/tty/vt/vt.c:3754 tty_init+0x152/0x1a0 drivers/tty/tty_io.c:3670 do_one_initcall+0x248/0x880 init/main.c:1269 do_initcall_level+0x157/0x210 init/main.c:1331 do_initcalls+0x3f/0x80 init/main.c:1347 kernel_init_freeable+0x435/0x5d0 init/main.c:1580 kernel_init+0x1d/0x2b0 init/main.c:1469 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88801ac65fa0 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of allocated 6-byte region [ffff88801ac65fa0, ffff88801ac65fa6) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1ac65 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff88801ac41500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080800080 00000001fdffffff 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 0x0(), pid 0, tgid 0 (swapper), ts 1614329132, free_ts 0 create_dummy_stack mm/page_owner.c:94 [inline] register_early_stack+0x8a/0xe0 mm/page_owner.c:110 init_page_owner+0x48/0x970 mm/page_owner.c:120 invoke_init_callbacks mm/page_ext.c:148 [inline] page_ext_init+0x731/0x790 mm/page_ext.c:497 mm_core_init+0x4c/0x60 mm/mm_init.c:2673 page_owner free stack trace missing Memory state around the buggy address: ffff88801ac65e80: 06 fc fc fc 06 fc fc fc 05 fc fc fc fa fc fc fc ffff88801ac65f00: 06 fc fc fc 06 fc fc fc 06 fc fc fc 05 fc fc fc >ffff88801ac65f80: 00 fc fc fc 06 fc fc fc 06 fc fc fc 06 fc fc fc ^ ffff88801ac66000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801ac66080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================