================================================================== BUG: KASAN: use-after-free in __list_add_valid+0x36/0xc0 lib/list_debug.c:23 Read of size 8 at addr ffff8880873feec8 by task syz-executor.1/17545 CPU: 0 PID: 17545 Comm: syz-executor.1 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 __list_add_valid+0x36/0xc0 lib/list_debug.c:23 __list_add include/linux/list.h:67 [inline] list_add include/linux/list.h:86 [inline] fw_load_sysfs_fallback+0x110/0x720 drivers/base/firmware_loader/fallback.c:516 fw_load_from_user_helper+0x242/0x320 drivers/base/firmware_loader/fallback.c:581 _request_firmware+0x3b4/0x560 drivers/base/firmware_loader/main.c:833 request_firmware+0x35/0x50 drivers/base/firmware_loader/main.c:877 reg_reload_regdb+0x81/0x200 net/wireless/reg.c:1095 genl_family_rcv_msg_doit net/netlink/genetlink.c:739 [inline] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0xfb4/0x13c0 net/netlink/genetlink.c:800 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2504 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 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] ____sys_sendmsg+0x5a2/0x900 net/socket.c:2392 ___sys_sendmsg net/socket.c:2446 [inline] __sys_sendmsg+0x319/0x400 net/socket.c:2475 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:00007ff4e094d188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007fff0e39530f R14: 00007ff4e094d300 R15: 0000000000022000 Allocated by task 17515: 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] __allocate_fw_priv+0x98/0x330 drivers/base/firmware_loader/main.c:187 alloc_lookup_fw_priv+0x1c0/0x380 drivers/base/firmware_loader/main.c:251 _request_firmware_prepare+0x27c/0x630 drivers/base/firmware_loader/main.c:746 _request_firmware+0x11b/0x560 drivers/base/firmware_loader/main.c:808 request_firmware+0x35/0x50 drivers/base/firmware_loader/main.c:877 reg_reload_regdb+0x81/0x200 net/wireless/reg.c:1095 genl_family_rcv_msg_doit net/netlink/genetlink.c:739 [inline] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0xfb4/0x13c0 net/netlink/genetlink.c:800 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2504 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 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] ____sys_sendmsg+0x5a2/0x900 net/socket.c:2392 ___sys_sendmsg net/socket.c:2446 [inline] __sys_sendmsg+0x319/0x400 net/socket.c:2475 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 17515: 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 kref_put include/linux/kref.h:65 [inline] free_fw_priv drivers/base/firmware_loader/main.c:290 [inline] firmware_free_data drivers/base/firmware_loader/main.c:586 [inline] release_firmware+0x139/0x1b0 drivers/base/firmware_loader/main.c:1055 _request_firmware+0x408/0x560 drivers/base/firmware_loader/main.c:841 request_firmware+0x35/0x50 drivers/base/firmware_loader/main.c:877 reg_reload_regdb+0x81/0x200 net/wireless/reg.c:1095 genl_family_rcv_msg_doit net/netlink/genetlink.c:739 [inline] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0xfb4/0x13c0 net/netlink/genetlink.c:800 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2504 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 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] ____sys_sendmsg+0x5a2/0x900 net/socket.c:2392 ___sys_sendmsg net/socket.c:2446 [inline] __sys_sendmsg+0x319/0x400 net/socket.c:2475 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 ffff8880873fee00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 200 bytes inside of 256-byte region [ffff8880873fee00, ffff8880873fef00) The buggy address belongs to the page: page:ffffea00021cff80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x873fe head:ffffea00021cff80 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000c73580 0000000400000003 ffff888011041b40 raw: 0000000000000000 0000000000100010 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 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 16849, ts 307320975795, free_ts 288024329753 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] kmem_cache_alloc_trace+0x29d/0x340 mm/slub.c:2981 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+0x946/0xd00 security/smack/smack_lsm.c:3445 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 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 kasan_depopulate_vmalloc_pte+0x66/0x80 mm/kasan/shadow.c:375 apply_to_pte_range mm/memory.c:2532 [inline] apply_to_pmd_range mm/memory.c:2576 [inline] apply_to_pud_range mm/memory.c:2612 [inline] apply_to_p4d_range mm/memory.c:2648 [inline] __apply_to_page_range+0x9e4/0xc40 mm/memory.c:2682 kasan_release_vmalloc+0x96/0xb0 mm/kasan/shadow.c:485 __purge_vmap_area_lazy+0xcba/0x18d0 mm/vmalloc.c:1670 _vm_unmap_aliases+0x474/0x500 mm/vmalloc.c:2073 change_page_attr_set_clr+0x2ae/0x680 arch/x86/mm/pat/set_memory.c:1740 change_page_attr_clear arch/x86/mm/pat/set_memory.c:1797 [inline] set_memory_ro+0xa4/0xe0 arch/x86/mm/pat/set_memory.c:1943 bpf_jit_binary_lock_ro include/linux/filter.h:866 [inline] bpf_int_jit_compile+0xb515/0xbae0 arch/x86/net/bpf_jit_comp.c:2319 bpf_prog_select_runtime+0x65d/0x970 kernel/bpf/core.c:1909 bpf_prog_load kernel/bpf/syscall.c:2278 [inline] __sys_bpf+0x10973/0x11d60 kernel/bpf/syscall.c:4469 __do_sys_bpf kernel/bpf/syscall.c:4573 [inline] __se_sys_bpf kernel/bpf/syscall.c:4571 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4571 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: ffff8880873fed80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880873fee00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880873fee80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880873fef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880873fef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================