================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x78/0x1f80 kernel/locking/lockdep.c:4923 Read of size 8 at addr ffff888079679ca8 by task syz-executor.4/9046 CPU: 0 PID: 9046 Comm: syz-executor.4 Not tainted 5.19.0-rc5-syzkaller-00233-gb1c428b6c368 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:313 print_report+0xf4/0x210 mm/kasan/report.c:429 kasan_report+0xfb/0x130 mm/kasan/report.c:491 __lock_acquire+0x78/0x1f80 kernel/locking/lockdep.c:4923 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5665 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:374 [inline] post_one_notification+0x54/0x900 kernel/watch_queue.c:86 __post_watch_notification+0x36e/0x850 kernel/watch_queue.c:206 post_watch_notification include/linux/watch_queue.h:109 [inline] notify_key security/keys/internal.h:199 [inline] __key_update+0x428/0x4e0 security/keys/key.c:775 key_create_or_update+0xa8f/0xd60 security/keys/key.c:979 __do_sys_add_key security/keys/keyctl.c:134 [inline] __se_sys_add_key+0x338/0x480 security/keys/keyctl.c:74 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7fc5b0289109 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc5b130a168 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00007fc5b039bf60 RCX: 00007fc5b0289109 RDX: 0000000020000280 RSI: 0000000020000240 RDI: 0000000020000200 RBP: 00007fc5b02e305d R08: fffffffffffffffb R09: 0000000000000000 R10: 0000000000000048 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff675939bf R14: 00007fc5b130a300 R15: 0000000000022000 Allocated by task 9047: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:515 kasan_kmalloc include/linux/kasan.h:234 [inline] kmem_cache_alloc_trace+0x94/0x310 mm/slub.c:3284 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] alloc_pipe_info+0xe2/0x4a0 fs/pipe.c:790 get_pipe_inode fs/pipe.c:881 [inline] create_pipe_files+0x84/0x6e0 fs/pipe.c:913 __do_pipe_flags+0x46/0x200 fs/pipe.c:962 do_pipe2+0xd0/0x300 fs/pipe.c:1010 __do_sys_pipe2 fs/pipe.c:1028 [inline] __se_sys_pipe2 fs/pipe.c:1026 [inline] __x64_sys_pipe2+0x56/0x60 fs/pipe.c:1026 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 9043: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0xd8/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1780 slab_free mm/slub.c:3536 [inline] kfree+0xc6/0x210 mm/slub.c:4584 put_pipe_info fs/pipe.c:711 [inline] pipe_release+0x232/0x310 fs/pipe.c:734 __fput+0x3b9/0x820 fs/file_table.c:317 task_work_run+0x146/0x1c0 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x134/0x160 kernel/entry/common.c:169 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The buggy address belongs to the object at ffff888079679c00 which belongs to the cache kmalloc-cg-512 of size 512 The buggy address is located 168 bytes inside of 512-byte region [ffff888079679c00, ffff888079679e00) The buggy address belongs to the physical page: page:ffffea0001e59e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79678 head:ffffea0001e59e00 order:2 compound_mapcount:0 compound_pincount:0 memcg:ffff88805f1c0101 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001746100 dead000000000002 ffff888011c42dc0 raw: 0000000000000000 0000000000100010 00000001ffffffff ffff88805f1c0101 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 2980, tgid 2980 (udevd), ts 21389277779, free_ts 21358925208 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4198 __alloc_pages+0x259/0x560 mm/page_alloc.c:5426 alloc_slab_page+0x70/0xf0 mm/slub.c:1824 allocate_slab+0x5e/0x520 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x42e/0xce0 mm/slub.c:3031 __slab_alloc mm/slub.c:3118 [inline] slab_alloc_node mm/slub.c:3209 [inline] __kmalloc_node_track_caller+0x2bb/0x3f0 mm/slub.c:4979 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0x11d/0x660 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1426 [inline] alloc_skb_with_frags+0xac/0x800 net/core/skbuff.c:5992 sock_alloc_send_pskb+0x930/0xa70 net/core/sock.c:2662 unix_dgram_sendmsg+0x5ca/0x1fc0 net/unix/af_unix.c:1895 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] sock_write_iter+0x3e7/0x560 net/socket.c:1108 call_write_iter include/linux/fs.h:2058 [inline] new_sync_write fs/read_write.c:504 [inline] vfs_write+0xa22/0xd40 fs/read_write.c:591 ksys_write+0x19b/0x2c0 fs/read_write.c:644 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1371 [inline] free_pcp_prepare+0x812/0x900 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page+0x7d/0x390 mm/page_alloc.c:3438 do_slab_free mm/slub.c:3524 [inline] ___cache_free+0x118/0x1a0 mm/slub.c:3543 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmalloc+0x1bd/0x370 mm/slub.c:4442 kmalloc include/linux/slab.h:605 [inline] tomoyo_realpath_from_path+0xd8/0x5f0 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x270/0x6b0 security/tomoyo/file.c:822 security_inode_getattr+0xc0/0x140 security/security.c:1344 vfs_getattr+0x26/0x360 fs/stat.c:157 vfs_statx+0x183/0x3f0 fs/stat.c:232 vfs_fstatat fs/stat.c:255 [inline] __do_sys_newfstatat fs/stat.c:425 [inline] __se_sys_newfstatat+0xf6/0x790 fs/stat.c:419 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Memory state around the buggy address: ffff888079679b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888079679c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888079679c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888079679d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888079679d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================