================================================================== BUG: KASAN: use-after-free in timerfd_clock_was_set+0x2b8/0x2e0 fs/timerfd.c:104 Read of size 8 at addr ffff888058a0b8f8 by task syz-executor.4/20241 CPU: 1 PID: 20241 Comm: syz-executor.4 Not tainted 5.14.0-rc7-syzkaller #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:105 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 timerfd_clock_was_set+0x2b8/0x2e0 fs/timerfd.c:104 do_settimeofday64 kernel/time/timekeeping.c:1327 [inline] do_settimeofday64+0x3dd/0x5c0 kernel/time/timekeeping.c:1293 do_sys_settimeofday64 kernel/time/time.c:195 [inline] do_sys_settimeofday64+0x1de/0x260 kernel/time/time.c:169 __do_sys_clock_settime kernel/time/posix-timers.c:1079 [inline] __se_sys_clock_settime kernel/time/posix-timers.c:1067 [inline] __x64_sys_clock_settime+0x1a1/0x280 kernel/time/posix-timers.c:1067 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:0x4665e9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6aee005188 EFLAGS: 00000246 ORIG_RAX: 00000000000000e3 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000000 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffd432bb0bf R14: 00007f6aee005300 R15: 0000000000022000 Allocated by task 1: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa4/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] __do_sys_timerfd_create+0x265/0x370 fs/timerfd.c:412 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 26: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1628 [inline] slab_free_freelist_hook+0xe3/0x250 mm/slub.c:1653 slab_free mm/slub.c:3213 [inline] kfree+0xe4/0x540 mm/slub.c:4267 kvfree+0x42/0x50 mm/util.c:616 kfree_rcu_work+0x5b7/0x870 kernel/rcu/tree.c:3359 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe9/0x110 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3594 timerfd_release+0x105/0x290 fs/timerfd.c:229 __fput+0x288/0x920 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888058a0b800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 248 bytes inside of 512-byte region [ffff888058a0b800, ffff888058a0ba00) The buggy address belongs to the page: page:ffffea0001628200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x58a08 head:ffffea0001628200 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010841c80 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8452, ts 92146526173, free_ts 0 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4168 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5390 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 alloc_slab_page mm/slub.c:1691 [inline] allocate_slab+0x32e/0x4b0 mm/slub.c:1831 new_slab mm/slub.c:1894 [inline] new_slab_objects mm/slub.c:2640 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2803 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2843 slab_alloc_node mm/slub.c:2925 [inline] __kmalloc_node_track_caller+0x2e3/0x360 mm/slub.c:4653 kmalloc_reserve net/core/skbuff.c:355 [inline] pskb_expand_head+0x15e/0x1060 net/core/skbuff.c:1696 netlink_trim+0x1ea/0x240 net/netlink/af_netlink.c:1296 netlink_broadcast_filtered+0x65/0xdc0 net/netlink/af_netlink.c:1501 netlink_broadcast net/netlink/af_netlink.c:1546 [inline] nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0x90/0x250 net/netlink/af_netlink.c:2547 rtmsg_fib+0x2e3/0x450 net/ipv4/fib_semantics.c:532 fib_table_insert+0x714/0x1af0 net/ipv4/fib_trie.c:1389 fib_magic+0x455/0x540 net/ipv4/fib_frontend.c:1087 fib_add_ifaddr+0x16c/0x500 net/ipv4/fib_frontend.c:1109 fib_inetaddr_event+0x162/0x2a0 net/ipv4/fib_frontend.c:1420 page_owner free stack trace missing Memory state around the buggy address: ffff888058a0b780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888058a0b800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888058a0b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888058a0b900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888058a0b980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================