================================================================== BUG: KASAN: use-after-free in kill_pending_fw_fallback_reqs+0x66/0x290 drivers/base/firmware_loader/fallback.c:116 Read of size 8 at addr ffff8880883d20c0 by task syz-executor.2/23551 CPU: 1 PID: 23551 Comm: syz-executor.2 Not tainted 5.14.0-rc4-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+0x1ae/0x29f lib/dump_stack.c:105 print_address_description+0x66/0x3b0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x163/0x210 mm/kasan/report.c:436 kill_pending_fw_fallback_reqs+0x66/0x290 drivers/base/firmware_loader/fallback.c:116 fw_pm_notify+0x5d/0xe0 drivers/base/firmware_loader/main.c:1450 notifier_call_chain kernel/notifier.c:83 [inline] notifier_call_chain_robust kernel/notifier.c:118 [inline] blocking_notifier_call_chain_robust+0x13b/0x380 kernel/notifier.c:302 pm_notifier_call_chain_robust+0x27/0x50 kernel/power/main.c:87 snapshot_open+0x18a/0x260 kernel/power/user.c:75 misc_open+0x346/0x3c0 drivers/char/misc.c:141 chrdev_open+0x53b/0x5f0 fs/char_dev.c:414 do_dentry_open+0x7cb/0x1020 fs/open.c:826 do_open fs/namei.c:3374 [inline] path_openat+0x27e7/0x36b0 fs/namei.c:3507 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 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+0x243/0x290 fs/open.c:1231 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/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:00007f1844f75188 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000020000380 RDI: ffffffffffffff9c RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffe44ab7bcf R14: 00007f1844f75300 R15: 0000000000022000 Allocated by task 17851: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xc4/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x96/0x340 mm/slub.c:2983 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] smk_fetch security/smack/smack_lsm.c:288 [inline] smack_d_instantiate+0xab7/0xd00 security/smack/smack_lsm.c:3451 security_d_instantiate+0xa5/0x100 security/security.c:2038 d_instantiate+0x51/0x90 fs/dcache.c:2008 shmem_mknod+0x165/0x1b0 mm/shmem.c:2843 lookup_open fs/namei.c:3228 [inline] open_last_lookups fs/namei.c:3298 [inline] path_openat+0x13b7/0x36b0 fs/namei.c:3504 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 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+0x221/0x270 fs/open.c:1224 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 17851: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0x109/0x150 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1625 [inline] slab_free_freelist_hook+0x1d8/0x290 mm/slub.c:1650 slab_free mm/slub.c:3210 [inline] kfree+0xd0/0x1f0 mm/slub.c:4264 smk_fetch security/smack/smack_lsm.c:300 [inline] smack_d_instantiate+0xb35/0xd00 security/smack/smack_lsm.c:3451 security_d_instantiate+0xa5/0x100 security/security.c:2038 d_instantiate+0x51/0x90 fs/dcache.c:2008 shmem_mknod+0x165/0x1b0 mm/shmem.c:2843 lookup_open fs/namei.c:3228 [inline] open_last_lookups fs/namei.c:3298 [inline] path_openat+0x13b7/0x36b0 fs/namei.c:3504 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 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+0x221/0x270 fs/open.c:1224 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x27/0x50 mm/kasan/common.c:38 kasan_record_aux_stack+0xee/0x120 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3029 [inline] call_rcu+0x1a0/0xa20 kernel/rcu/tree.c:3109 fib6_info_release include/net/ip6_fib.h:337 [inline] fib6_del_route net/ipv6/ip6_fib.c:1995 [inline] fib6_del+0x10dd/0x1480 net/ipv6/ip6_fib.c:2028 fib6_clean_node+0x301/0x5f0 net/ipv6/ip6_fib.c:2190 fib6_walk_continue+0x62e/0x8b0 net/ipv6/ip6_fib.c:2112 fib6_walk net/ipv6/ip6_fib.c:2160 [inline] fib6_clean_tree net/ipv6/ip6_fib.c:2240 [inline] __fib6_clean_all+0x4fa/0x860 net/ipv6/ip6_fib.c:2256 rt6_sync_down_dev net/ipv6/route.c:4896 [inline] rt6_disable_ip+0x15d/0x6c0 net/ipv6/route.c:4901 addrconf_ifdown+0xfb/0x1820 net/ipv6/addrconf.c:3706 addrconf_notify+0x49d/0x2110 net/ipv6/addrconf.c:3631 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2123 [inline] call_netdevice_notifiers_extack net/core/dev.c:2135 [inline] call_netdevice_notifiers net/core/dev.c:2149 [inline] dev_close_many+0x38b/0x540 net/core/dev.c:1724 unregister_netdevice_many+0x53a/0x1980 net/core/dev.c:11070 ip6gre_exit_batch_net+0x455/0x4a0 net/ipv6/ip6_gre.c:1628 ops_exit_list net/core/net_namespace.c:178 [inline] cleanup_net+0x7ec/0xc60 net/core/net_namespace.c:595 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1320 kernel/workqueue.c:2422 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Second to last potentially related work creation: kasan_save_stack+0x27/0x50 mm/kasan/common.c:38 kasan_record_aux_stack+0xee/0x120 mm/kasan/generic.c:348 kvfree_call_rcu+0x114/0x8a0 kernel/rcu/tree.c:3594 ip_mc_destroy_dev+0x55/0x4a0 net/ipv4/igmp.c:1796 inetdev_destroy net/ipv4/devinet.c:315 [inline] inetdev_event+0x577/0x14d0 net/ipv4/devinet.c:1598 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2123 [inline] call_netdevice_notifiers_mtu net/core/dev.c:2172 [inline] dev_set_mtu_ext+0x604/0x960 net/core/dev.c:8964 do_setlink+0x951/0x3f70 net/core/rtnetlink.c:2684 rtnl_setlink+0x3b2/0x500 net/core/rtnetlink.c:3014 rtnetlink_rcv_msg+0x91c/0xe50 net/core/rtnetlink.c:5574 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2504 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x7de/0x9b0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x9e7/0xe00 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg net/socket.c:723 [inline] sock_write_iter+0x398/0x520 net/socket.c:1056 do_iter_readv_writev+0x566/0x770 include/linux/fs.h:2108 do_iter_write+0x16c/0x5f0 fs/read_write.c:866 vfs_writev fs/read_write.c:939 [inline] do_writev+0x240/0x440 fs/read_write.c:982 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff8880883d2000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 192 bytes inside of 256-byte region [ffff8880883d2000, ffff8880883d2100) The buggy address belongs to the page: page:ffffea000220f480 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880883d2c00 pfn:0x883d2 head:ffffea000220f480 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000c1f600 0000000800000006 ffff888011041b40 raw: ffff8880883d2c00 000000008010000f 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 8657, ts 171595933691, free_ts 171522911426 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4169 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5391 alloc_slab_page mm/slub.c:1688 [inline] allocate_slab+0xf1/0x540 mm/slub.c:1828 new_slab mm/slub.c:1891 [inline] new_slab_objects mm/slub.c:2637 [inline] ___slab_alloc+0x1cf/0x350 mm/slub.c:2800 __slab_alloc mm/slub.c:2840 [inline] slab_alloc_node mm/slub.c:2922 [inline] slab_alloc mm/slub.c:2964 [inline] __kmalloc+0x2e7/0x390 mm/slub.c:4108 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] fib_create_info+0x1701/0x7080 net/ipv4/fib_semantics.c:1419 fib_table_insert+0x24c/0x2460 net/ipv4/fib_trie.c:1224 fib_magic+0x447/0x610 net/ipv4/fib_frontend.c:1087 fib_add_ifaddr+0x140/0x580 net/ipv4/fib_frontend.c:1109 fib_netdev_event+0x718/0x860 net/ipv4/fib_frontend.c:1466 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:410 __dev_notify_flags+0x306/0x5d0 net/core/dev.c:2123 dev_change_flags+0xe3/0x190 net/core/dev.c:8898 do_setlink+0xcbd/0x3f70 net/core/rtnetlink.c:2721 __rtnl_newlink net/core/rtnetlink.c:3393 [inline] rtnl_newlink+0x16e4/0x1cd0 net/core/rtnetlink.c:3508 rtnetlink_rcv_msg+0x91c/0xe50 net/core/rtnetlink.c:5574 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+0xc29/0xd20 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page+0x7e/0x550 mm/page_alloc.c:3411 free_slab mm/slub.c:1931 [inline] discard_slab mm/slub.c:1937 [inline] __slab_free+0x5c0/0x6b0 mm/slub.c:3140 do_slab_free mm/slub.c:3198 [inline] ___cache_free+0xfc/0x120 mm/slub.c:3217 qlist_free_all mm/kasan/quarantine.c:165 [inline] kasan_quarantine_reduce+0x151/0x1c0 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:2956 [inline] slab_alloc mm/slub.c:2964 [inline] kmem_cache_alloc+0x1d1/0x340 mm/slub.c:2969 getname_flags+0xba/0x640 fs/namei.c:138 do_sys_openat2+0xba/0x460 fs/open.c:1198 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+0x221/0x270 fs/open.c:1224 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff8880883d1f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880883d2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880883d2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880883d2100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880883d2180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================