================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3eb0/0x56c0 kernel/locking/lockdep.c:4899 Read of size 8 at addr ffff8880765154a8 by task syz-executor.3/8779 CPU: 0 PID: 8779 Comm: syz-executor.3 Not tainted 5.18.0-rc4-syzkaller-00036-gcf424ef014ac #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 __lock_acquire+0x3eb0/0x56c0 kernel/locking/lockdep.c:4899 lock_acquire kernel/locking/lockdep.c:5641 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5606 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0x32/0x50 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:374 [inline] post_one_notification.isra.0+0x59/0x990 kernel/watch_queue.c:86 __post_watch_notification kernel/watch_queue.c:206 [inline] __post_watch_notification+0x561/0x840 kernel/watch_queue.c:176 post_watch_notification include/linux/watch_queue.h:109 [inline] notify_key security/keys/internal.h:199 [inline] __key_update security/keys/key.c:775 [inline] key_create_or_update+0xdbf/0xde0 security/keys/key.c:979 __do_sys_add_key+0x215/0x430 security/keys/keyctl.c:134 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f57f40890e9 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:00007f57f52bd168 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00007f57f419bf60 RCX: 00007f57f40890e9 RDX: 0000000020000080 RSI: 0000000020000040 RDI: 0000000020000000 RBP: 00007f57f40e308d R08: fffffffffffffffb R09: 0000000000000000 R10: 0000000000000048 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc3d3980ef R14: 00007f57f52bd300 R15: 0000000000022000 Allocated by task 8750: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] alloc_pipe_info+0x105/0x590 fs/pipe.c:790 get_pipe_inode fs/pipe.c:881 [inline] create_pipe_files+0x8d/0x880 fs/pipe.c:913 __do_pipe_flags fs/pipe.c:962 [inline] do_pipe2+0x96/0x1b0 fs/pipe.c:1010 __do_sys_pipe2 fs/pipe.c:1028 [inline] __se_sys_pipe2 fs/pipe.c:1026 [inline] __x64_sys_pipe2+0x50/0x70 fs/pipe.c:1026 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 8773: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3510 [inline] kfree+0xd6/0x4d0 mm/slub.c:4552 put_pipe_info fs/pipe.c:711 [inline] pipe_release+0x2b6/0x310 fs/pipe.c:734 __fput+0x277/0x9d0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:37 [inline] do_exit+0xaff/0x2a00 kernel/exit.c:795 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 get_signal+0x22df/0x24c0 kernel/signal.c:2864 arch_do_signal_or_restart+0x82/0x20f0 arch/x86/kernel/signal.c:867 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201 irqentry_exit_to_user_mode+0x5/0x40 kernel/entry/common.c:307 exc_page_fault+0xc6/0x180 arch/x86/mm/fault.c:1543 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:570 The buggy address belongs to the object at ffff888076515400 which belongs to the cache kmalloc-cg-512 of size 512 The buggy address is located 168 bytes inside of 512-byte region [ffff888076515400, ffff888076515600) The buggy address belongs to the physical page: page:ffffea0001d94500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x76514 head:ffffea0001d94500 order:2 compound_mapcount:0 compound_pincount:0 memcg:ffff888078bb6001 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000572600 dead000000000003 ffff888010c42dc0 raw: 0000000000000000 0000000000100010 00000001ffffffff ffff888078bb6001 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 2951, tgid 2951 (klogd), ts 128559754789, free_ts 128475029977 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x8df/0xf20 mm/slub.c:3005 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3092 slab_alloc_node mm/slub.c:3183 [inline] __kmalloc_node_track_caller+0x2cb/0x360 mm/slub.c:4947 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1300 [inline] alloc_skb_with_frags+0x93/0x730 net/core/skbuff.c:5995 sock_alloc_send_pskb+0x793/0x920 net/core/sock.c:2600 unix_dgram_sendmsg+0x414/0x1a90 net/unix/af_unix.c:1896 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 __sys_sendto+0x216/0x310 net/socket.c:2040 __do_sys_sendto net/socket.c:2052 [inline] __se_sys_sendto net/socket.c:2048 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2048 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1356 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3328 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3423 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283 ____kasan_kmalloc mm/kasan/common.c:481 [inline] __kasan_kmalloc+0xbd/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:581 [inline] syslog_print+0xc7/0x580 kernel/printk/printk.c:1500 do_syslog.part.0+0x1db/0x5f0 kernel/printk/printk.c:1668 do_syslog kernel/printk/printk.c:1758 [inline] __do_sys_syslog kernel/printk/printk.c:1760 [inline] __se_sys_syslog kernel/printk/printk.c:1758 [inline] __x64_sys_syslog+0x97/0xc0 kernel/printk/printk.c:1758 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888076515380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888076515400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888076515480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888076515500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888076515580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================