================================================================== BUG: KASAN: use-after-free in kill_pending_fw_fallback_reqs+0x2fb/0x370 drivers/base/firmware_loader/fallback.c:116 Read of size 8 at addr ffff8880221afec0 by task syz-executor.1/22607 CPU: 1 PID: 22607 Comm: syz-executor.1 Not tainted 5.14.0-rc4-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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/0x2d6 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 kill_pending_fw_fallback_reqs+0x2fb/0x370 drivers/base/firmware_loader/fallback.c:116 fw_pm_notify+0xa2/0x140 drivers/base/firmware_loader/main.c:1450 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 notifier_call_chain_robust kernel/notifier.c:118 [inline] blocking_notifier_call_chain_robust kernel/notifier.c:302 [inline] blocking_notifier_call_chain_robust+0xc4/0x160 kernel/notifier.c:290 pm_notifier_call_chain_robust+0x26/0x60 kernel/power/main.c:87 snapshot_open+0x190/0x2a0 kernel/power/user.c:75 misc_open+0x372/0x4a0 drivers/char/misc.c:141 chrdev_open+0x266/0x770 fs/char_dev.c:414 do_dentry_open+0x4c8/0x11d0 fs/open.c:826 do_open fs/namei.c:3374 [inline] path_openat+0x1c23/0x27f0 fs/namei.c:3507 do_filp_open+0x1aa/0x400 fs/namei.c:3534 do_sys_openat2+0x16d/0x420 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_openat fs/open.c:1236 [inline] __se_sys_openat fs/open.c:1231 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1231 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:0x4196d4 Code: 84 00 00 00 00 00 44 89 54 24 0c e8 96 f9 ff ff 44 8b 54 24 0c 44 89 e2 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 89 44 24 0c e8 c8 f9 ff ff 8b 44 RSP: 002b:00007f77c8aeb060 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004196d4 RDX: 0000000000000000 RSI: 00007f77c8aeb0f0 RDI: 00000000ffffff9c RBP: 00007f77c8aeb0f0 R08: 0000000000000000 R09: 00007f77c8aeaf70 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 00007ffde6bd74ff R14: 00007f77c8aeb300 R15: 0000000000022000 Allocated by task 20644: 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+0x98/0xc0 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x1e4/0x480 mm/slab.c:3575 kmalloc include/linux/slab.h:591 [inline] tc_action_net_init include/net/act_api.h:129 [inline] pedit_init_net+0x13a/0x4a0 net/sched/act_pedit.c:508 ops_init+0xaf/0x470 net/core/net_namespace.c:140 setup_net+0x40f/0xa30 net/core/net_namespace.c:333 copy_net_ns+0x319/0x760 net/core/net_namespace.c:474 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3002 __do_sys_unshare kernel/fork.c:3076 [inline] __se_sys_unshare kernel/fork.c:3074 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3074 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 The buggy address belongs to the object at ffff8880221afe00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 192 bytes inside of 256-byte region [ffff8880221afe00, ffff8880221aff00) The buggy address belongs to the page: page:ffffea0000886bc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880221af600 pfn:0x221af flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00009de408 ffffea00008bf948 ffff888010840500 raw: ffff8880221af600 ffff8880221af000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x242040(__GFP_IO|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 5053, ts 65615846042, free_ts 65615830190 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4169 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5391 __alloc_pages_node include/linux/gfp.h:570 [inline] kmem_getpages mm/slab.c:1377 [inline] cache_grow_begin+0x75/0x460 mm/slab.c:2593 cache_alloc_refill+0x27f/0x380 mm/slab.c:2965 ____cache_alloc mm/slab.c:3048 [inline] ____cache_alloc mm/slab.c:3031 [inline] __do_cache_alloc mm/slab.c:3275 [inline] slab_alloc mm/slab.c:3316 [inline] kmem_cache_alloc_trace+0x38c/0x480 mm/slab.c:3573 kmalloc include/linux/slab.h:591 [inline] inode_doinit_use_xattr+0x54/0x340 security/selinux/hooks.c:1389 inode_doinit_with_dentry+0x10ec/0x12e0 security/selinux/hooks.c:1580 selinux_d_instantiate+0x23/0x30 security/selinux/hooks.c:6444 security_d_instantiate+0x50/0xe0 security/security.c:2038 d_splice_alias+0x8c/0xc60 fs/dcache.c:3064 kernfs_iop_lookup+0x1ac/0x220 fs/kernfs/dir.c:1107 lookup_open.isra.0+0x69f/0x13d0 fs/namei.c:3206 open_last_lookups fs/namei.c:3298 [inline] path_openat+0x9b3/0x27f0 fs/namei.c:3504 do_filp_open+0x1aa/0x400 fs/namei.c:3534 do_sys_openat2+0x16d/0x420 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_open fs/open.c:1228 [inline] __se_sys_open fs/open.c:1224 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1224 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1346 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3411 selinux_genfs_get_sid security/selinux/hooks.c:1376 [inline] inode_doinit_with_dentry+0x868/0x12e0 security/selinux/hooks.c:1571 selinux_d_instantiate+0x23/0x30 security/selinux/hooks.c:6444 security_d_instantiate+0x50/0xe0 security/security.c:2038 d_splice_alias+0x8c/0xc60 fs/dcache.c:3064 kernfs_iop_lookup+0x1ac/0x220 fs/kernfs/dir.c:1107 lookup_open.isra.0+0x69f/0x13d0 fs/namei.c:3206 open_last_lookups fs/namei.c:3298 [inline] path_openat+0x9b3/0x27f0 fs/namei.c:3504 do_filp_open+0x1aa/0x400 fs/namei.c:3534 do_sys_openat2+0x16d/0x420 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_open fs/open.c:1228 [inline] __se_sys_open fs/open.c:1224 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1224 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: ffff8880221afd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880221afe00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880221afe80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880221aff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880221aff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================