================================================================== BUG: KASAN: use-after-free in __lock_acquire+0xda/0x2b00 kernel/locking/lockdep.c:4899 Read of size 8 at addr ffff88807b84a4a8 by task kworker/0:4/3682 CPU: 0 PID: 3682 Comm: kworker/0:4 Not tainted 5.17.0-syzkaller-14114-g09bb8856d4a7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events key_garbage_collector Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:313 print_report+0xf4/0x200 mm/kasan/report.c:429 kasan_report+0x109/0x140 mm/kasan/report.c:491 __lock_acquire+0xda/0x2b00 kernel/locking/lockdep.c:4899 lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5641 __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 remove_watch_from_object+0x4d0/0xa70 kernel/watch_queue.c:527 remove_watch_list include/linux/watch_queue.h:115 [inline] key_gc_unused_keys+0x1c3/0x5b0 security/keys/gc.c:135 key_garbage_collector+0x89c/0x9e0 security/keys/gc.c:297 process_one_work+0x83c/0x11a0 kernel/workqueue.c:2289 worker_thread+0xa6c/0x1290 kernel/workqueue.c:2436 kthread+0x2a3/0x2d0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 Allocated by task 16972: 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+0x9d/0x330 mm/slub.c:3258 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] alloc_pipe_info+0xe2/0x4b0 fs/pipe.c:790 get_pipe_inode fs/pipe.c:881 [inline] create_pipe_files+0x83/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/0x50 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 16972: 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+0x136/0x1e0 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1754 slab_free mm/slub.c:3510 [inline] kfree+0xc6/0x390 mm/slub.c:4552 put_pipe_info fs/pipe.c:711 [inline] pipe_release+0x232/0x310 fs/pipe.c:734 __fput+0x3f6/0x860 fs/file_table.c:317 task_work_run+0x146/0x1c0 kernel/task_work.c:164 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:169 [inline] exit_to_user_mode_prepare+0x1d2/0x1f0 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88807b84a400 which belongs to the cache kmalloc-cg-512 of size 512 The buggy address is located 168 bytes inside of 512-byte region [ffff88807b84a400, ffff88807b84a600) The buggy address belongs to the physical page: page:ffffea0001ee1200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7b848 head:ffffea0001ee1200 order:2 compound_mapcount:0 compound_pincount:0 memcg:ffff888075c5b301 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888011442dc0 raw: 0000000000000000 0000000000100010 00000001ffffffff ffff888075c5b301 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3680, tgid 3680 (kworker/1:7), ts 128155308717, free_ts 128114197614 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0x708/0xa80 mm/page_alloc.c:4182 __alloc_pages+0x255/0x580 mm/page_alloc.c:5408 alloc_slab_page+0x70/0xf0 mm/slub.c:1799 allocate_slab+0x5d/0x380 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x40e/0xcc0 mm/slub.c:3005 __slab_alloc mm/slub.c:3092 [inline] slab_alloc_node mm/slub.c:3183 [inline] slab_alloc mm/slub.c:3225 [inline] kmem_cache_alloc_trace+0x28c/0x330 mm/slub.c:3256 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] ipv6_add_addr+0x41e/0x14d0 net/ipv6/addrconf.c:1088 addrconf_add_linklocal+0x35f/0xb30 net/ipv6/addrconf.c:3208 addrconf_addr_gen+0x34f/0xd90 addrconf_notify+0x17f4/0x2110 net/ipv6/addrconf.c:3624 notifier_call_chain kernel/notifier.c:84 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:392 call_netdevice_notifiers_info net/core/dev.c:1938 [inline] netdev_state_change+0x1aa/0x270 net/core/dev.c:1327 linkwatch_do_dev+0x10a/0x160 net/core/link_watch.c:167 __linkwatch_run_queue+0x508/0x810 net/core/link_watch.c:220 linkwatch_event+0x48/0x50 net/core/link_watch.c:263 process_one_work+0x83c/0x11a0 kernel/workqueue.c:2289 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+0xcfc/0xe70 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3328 [inline] free_unref_page+0x7d/0x580 mm/page_alloc.c:3423 do_slab_free mm/slub.c:3498 [inline] ___cache_free+0x117/0x1c0 mm/slub.c:3517 qlist_free_all mm/kasan/quarantine.c:176 [inline] kasan_quarantine_reduce+0x127/0x190 mm/kasan/quarantine.c:283 __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:749 [inline] slab_alloc_node mm/slub.c:3217 [inline] slab_alloc mm/slub.c:3225 [inline] __kmem_cache_alloc_lru mm/slub.c:3232 [inline] kmem_cache_alloc+0x1c9/0x310 mm/slub.c:3242 getname_flags+0xba/0x650 fs/namei.c:138 getname fs/namei.c:217 [inline] __do_sys_unlink fs/namei.c:4266 [inline] __se_sys_unlink fs/namei.c:4264 [inline] __x64_sys_unlink+0x38/0x50 fs/namei.c:4264 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x50 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88807b84a380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807b84a400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807b84a480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807b84a500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807b84a580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================