================================================================== BUG: KASAN: use-after-free in smk_destroy_label_list security/smack/smackfs.c:1975 [inline] BUG: KASAN: use-after-free in smk_write_relabel_self+0x2f6/0x480 security/smack/smackfs.c:2748 Read of size 8 at addr ffff8880981738c0 by task syz-executor.1/12495 CPU: 0 PID: 12495 Comm: syz-executor.1 Not tainted 5.7.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1e9/0x30e lib/dump_stack.c:118 print_address_description+0x66/0x5a0 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report+0x132/0x1d0 mm/kasan/report.c:530 smk_destroy_label_list security/smack/smackfs.c:1975 [inline] smk_write_relabel_self+0x2f6/0x480 security/smack/smackfs.c:2748 __vfs_write+0x9c/0x6e0 fs/read_write.c:495 __kernel_write+0x120/0x350 fs/read_write.c:516 write_pipe_buf+0xf9/0x150 fs/splice.c:799 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x351/0x8b0 fs/splice.c:626 splice_from_pipe fs/splice.c:661 [inline] default_file_splice_write fs/splice.c:811 [inline] do_splice_from fs/splice.c:847 [inline] direct_splice_actor+0x1eb/0x2a0 fs/splice.c:1016 splice_direct_to_actor+0x4a2/0xb60 fs/splice.c:971 do_splice_direct+0x201/0x340 fs/splice.c:1059 do_sendfile+0x809/0xfe0 fs/read_write.c:1521 __do_sys_sendfile64 fs/read_write.c:1582 [inline] __se_sys_sendfile64 fs/read_write.c:1568 [inline] __x64_sys_sendfile64+0x164/0x1a0 fs/read_write.c:1568 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x45ca69 Code: 0d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f5d87c51c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00000000004fc580 RCX: 000000000045ca69 RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000007 RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000100000064 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000008dc R14: 00000000004cba56 R15: 00007f5d87c526d4 Allocated by task 12510: save_stack mm/kasan/common.c:48 [inline] set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc+0x103/0x140 mm/kasan/common.c:494 kmem_cache_alloc_trace+0x234/0x300 mm/slab.c:3551 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:669 [inline] smk_parse_label_list+0xff/0x280 security/smack/smackfs.c:1955 smk_write_relabel_self+0x190/0x480 security/smack/smackfs.c:2744 __vfs_write+0x9c/0x6e0 fs/read_write.c:495 __kernel_write+0x120/0x350 fs/read_write.c:516 write_pipe_buf+0xf9/0x150 fs/splice.c:799 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x351/0x8b0 fs/splice.c:626 splice_from_pipe fs/splice.c:661 [inline] default_file_splice_write fs/splice.c:811 [inline] do_splice_from fs/splice.c:847 [inline] direct_splice_actor+0x1eb/0x2a0 fs/splice.c:1016 splice_direct_to_actor+0x4a2/0xb60 fs/splice.c:971 do_splice_direct+0x201/0x340 fs/splice.c:1059 do_sendfile+0x809/0xfe0 fs/read_write.c:1521 __do_sys_sendfile64 fs/read_write.c:1582 [inline] __se_sys_sendfile64 fs/read_write.c:1568 [inline] __x64_sys_sendfile64+0x164/0x1a0 fs/read_write.c:1568 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 12502: save_stack mm/kasan/common.c:48 [inline] set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0x114/0x170 mm/kasan/common.c:455 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x220 mm/slab.c:3757 smk_destroy_label_list security/smack/smackfs.c:1976 [inline] smk_write_relabel_self+0x302/0x480 security/smack/smackfs.c:2748 __vfs_write+0x9c/0x6e0 fs/read_write.c:495 __kernel_write+0x120/0x350 fs/read_write.c:516 write_pipe_buf+0xf9/0x150 fs/splice.c:799 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x351/0x8b0 fs/splice.c:626 splice_from_pipe fs/splice.c:661 [inline] default_file_splice_write fs/splice.c:811 [inline] do_splice_from fs/splice.c:847 [inline] direct_splice_actor+0x1eb/0x2a0 fs/splice.c:1016 splice_direct_to_actor+0x4a2/0xb60 fs/splice.c:971 do_splice_direct+0x201/0x340 fs/splice.c:1059 do_sendfile+0x809/0xfe0 fs/read_write.c:1521 __do_sys_sendfile64 fs/read_write.c:1582 [inline] __se_sys_sendfile64 fs/read_write.c:1568 [inline] __x64_sys_sendfile64+0x164/0x1a0 fs/read_write.c:1568 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff8880981738c0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff8880981738c0, ffff8880981738e0) The buggy address belongs to the page: page:ffffea0002605cc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888098173fc1 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00029be9c8 ffffea00024e3288 ffff8880aa4001c0 raw: ffff888098173fc1 ffff888098173000 000000010000003f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888098173780: 00 00 00 fc fc fc fc fc fb fb fb fb fc fc fc fc ffff888098173800: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff888098173880: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff888098173900: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff888098173980: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================