================================================================== BUG: KASAN: use-after-free in __lock_acquire+0xda/0x2b00 kernel/locking/lockdep.c:4897 Read of size 8 at addr ffff888078c598a8 by task syz-executor.3/15288 CPU: 0 PID: 15288 Comm: syz-executor.3 Not tainted 5.17.0-rc8-syzkaller-00003-g56e337f2cf13 #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+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x65/0x3a0 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:459 __lock_acquire+0xda/0x2b00 kernel/locking/lockdep.c:4897 lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5639 __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/0x830 kernel/watch_queue.c:86 __post_watch_notification+0x36f/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 security/keys/key.c:775 [inline] key_create_or_update+0x1200/0x1390 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+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7faf51a74049 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:00007faf503e9168 EFLAGS: 00000246 ORIG_RAX: 00000000000000f8 RAX: ffffffffffffffda RBX: 00007faf51b86f60 RCX: 00007faf51a74049 RDX: 00000000200000c0 RSI: 0000000020000080 RDI: 0000000020000040 RBP: 00007faf51ace08d R08: fffffffffffffffc R09: 0000000000000000 R10: 0000000000000048 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdf5aa7e1f R14: 00007faf503e9300 R15: 0000000000022000 Allocated by task 15266: 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:270 [inline] kmem_cache_alloc_trace+0x9d/0x330 mm/slub.c:3257 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] alloc_pipe_info+0xe2/0x4a0 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+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 15266: 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+0x126/0x180 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kfree+0xb8/0x2e0 mm/slub.c:4562 put_pipe_info fs/pipe.c:711 [inline] pipe_release+0x235/0x310 fs/pipe.c:734 __fput+0x3fc/0x870 fs/file_table.c:317 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x209/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:348 kvfree_call_rcu+0x119/0x880 kernel/rcu/tree.c:3591 in6_ifa_put include/net/addrconf.h:414 [inline] addrconf_ifdown+0x12d5/0x1a00 net/ipv6/addrconf.c:3868 addrconf_notify+0x49d/0x2110 notifier_call_chain kernel/notifier.c:84 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:392 __dev_notify_flags+0x306/0x5e0 dev_change_flags+0xe3/0x190 net/core/dev.c:8215 do_setlink+0xce5/0x4170 net/core/rtnetlink.c:2731 rtnl_group_changelink net/core/rtnetlink.c:3265 [inline] __rtnl_newlink net/core/rtnetlink.c:3421 [inline] rtnl_newlink+0x1161/0x1d80 net/core/rtnetlink.c:3531 rtnetlink_rcv_msg+0x96f/0xec0 net/core/rtnetlink.c:5596 netlink_rcv_skb+0x200/0x470 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x81a/0x9f0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0xaec/0xe60 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] ____sys_sendmsg+0x5b9/0x910 net/socket.c:2413 ___sys_sendmsg net/socket.c:2467 [inline] __sys_sendmsg+0x280/0x370 net/socket.c:2496 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:348 insert_work+0x54/0x400 kernel/workqueue.c:1368 __queue_work+0x97a/0xcc0 kernel/workqueue.c:1534 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1461 [inline] __run_timers+0x752/0x910 kernel/time/timer.c:1734 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1747 __do_softirq+0x392/0x7a3 kernel/softirq.c:558 The buggy address belongs to the object at ffff888078c59800 which belongs to the cache kmalloc-cg-512 of size 512 The buggy address is located 168 bytes inside of 512-byte region [ffff888078c59800, ffff888078c59a00) The buggy address belongs to the page: page:ffffea0001e31600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78c58 head:ffffea0001e31600 order:2 compound_mapcount:0 compound_pincount:0 memcg:ffff88807a721e01 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888011442dc0 raw: 0000000000000000 0000000080100010 00000001ffffffff ffff88807a721e01 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 2953, ts 149962654660, free_ts 149859905269 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0x729/0x9e0 mm/page_alloc.c:4165 __alloc_pages+0x255/0x580 mm/page_alloc.c:5389 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0xce/0x3f0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x3fe/0xc30 mm/slub.c:3018 __slab_alloc mm/slub.c:3105 [inline] slab_alloc_node mm/slub.c:3196 [inline] __kmalloc_node_track_caller+0x2df/0x400 mm/slub.c:4957 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0x127/0x5a0 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1158 [inline] alloc_skb_with_frags+0xab/0x670 net/core/skbuff.c:5956 sock_alloc_send_pskb+0x928/0xa60 net/core/sock.c:2586 unix_dgram_sendmsg+0x60e/0x29e0 net/unix/af_unix.c:1896 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] __sys_sendto+0x42e/0x5b0 net/socket.c:2040 __do_sys_sendto net/socket.c:2052 [inline] __se_sys_sendto net/socket.c:2048 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2048 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 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:1352 [inline] free_pcp_prepare+0xd1c/0xe00 mm/page_alloc.c:1404 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x7d/0x580 mm/page_alloc.c:3404 free_slab mm/slub.c:2043 [inline] discard_slab mm/slub.c:2049 [inline] __unfreeze_partials+0x1ab/0x200 mm/slub.c:2536 put_cpu_partial+0x116/0x180 mm/slub.c:2612 do_slab_free mm/slub.c:3497 [inline] ___cache_free+0x107/0x160 mm/slub.c:3516 qlist_free_all mm/kasan/quarantine.c:176 [inline] kasan_quarantine_reduce+0x169/0x1f0 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc_trace+0x20b/0x330 mm/slub.c:3255 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:714 [inline] smk_fetch security/smack/smack_lsm.c:290 [inline] smack_d_instantiate+0x8a6/0xd10 security/smack/smack_lsm.c:3453 security_d_instantiate+0xa5/0x100 security/security.c:2043 d_instantiate+0x51/0x90 fs/dcache.c:2033 shmem_mknod+0x165/0x1b0 mm/shmem.c:2827 lookup_open fs/namei.c:3330 [inline] open_last_lookups fs/namei.c:3400 [inline] path_openat+0x12ec/0x36a0 fs/namei.c:3606 do_filp_open+0x277/0x4f0 fs/namei.c:3636 do_sys_openat2+0x13b/0x500 fs/open.c:1214 do_sys_open fs/open.c:1230 [inline] __do_sys_openat fs/open.c:1246 [inline] __se_sys_openat fs/open.c:1241 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1241 Memory state around the buggy address: ffff888078c59780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888078c59800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888078c59880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888078c59900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078c59980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================