================================================================== BUG: KASAN: use-after-free in fb_mode_is_equal+0x284/0x2f0 drivers/video/fbdev/core/modedb.c:924 Read of size 4 at addr ffff88801e69171c by task syz-executor.1/7392 CPU: 1 PID: 7392 Comm: syz-executor.1 Not tainted 5.13.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:96 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 fb_mode_is_equal+0x284/0x2f0 drivers/video/fbdev/core/modedb.c:924 fbcon_mode_deleted+0x13d/0x1d0 drivers/video/fbdev/core/fbcon.c:2718 fb_set_var+0xae1/0xda0 drivers/video/fbdev/core/fbmem.c:975 do_fb_ioctl+0x2f9/0x690 drivers/video/fbdev/core/fbmem.c:1108 fb_ioctl+0xe7/0x150 drivers/video/fbdev/core/fbmem.c:1185 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl fs/ioctl.c:1055 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:1055 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:0x4665d9 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:00007eff51596188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665d9 RDX: 00000000200002c0 RSI: 0000000000004601 RDI: 0000000000000003 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffcd6e39a5f R14: 00007eff51596300 R15: 0000000000022000 Allocated by task 2958: 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:263 [inline] kmem_cache_alloc_trace+0x1fa/0x480 mm/slab.c:3575 kmalloc include/linux/slab.h:591 [inline] fb_add_videomode drivers/video/fbdev/core/modedb.c:1073 [inline] fb_add_videomode+0x2fb/0x610 drivers/video/fbdev/core/modedb.c:1057 fb_set_var+0x631/0xda0 drivers/video/fbdev/core/fbmem.c:1049 do_fb_ioctl+0x2f9/0x690 drivers/video/fbdev/core/fbmem.c:1108 fb_ioctl+0xe7/0x150 drivers/video/fbdev/core/fbmem.c:1185 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl fs/ioctl.c:1055 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:1055 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 7378: 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+0xcd/0x100 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:229 [inline] __cache_free mm/slab.c:3445 [inline] kfree+0x106/0x2c0 mm/slab.c:3803 fb_delete_videomode+0x3d2/0x570 drivers/video/fbdev/core/modedb.c:1104 fb_set_var+0xaf1/0xda0 drivers/video/fbdev/core/fbmem.c:978 do_fb_ioctl+0x2f9/0x690 drivers/video/fbdev/core/fbmem.c:1108 fb_ioctl+0xe7/0x150 drivers/video/fbdev/core/fbmem.c:1185 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl fs/ioctl.c:1055 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:1055 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 Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xa4/0xd0 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1332 __queue_work+0x5c1/0xed0 kernel/workqueue.c:1498 queue_work_on+0xee/0x110 kernel/workqueue.c:1525 queue_work include/linux/workqueue.h:507 [inline] schedule_work include/linux/workqueue.h:568 [inline] nfc_genl_rcv_nl_event net/nfc/netlink.c:1825 [inline] nfc_genl_rcv_nl_event+0x216/0x2e0 net/nfc/netlink.c:1810 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 blocking_notifier_call_chain kernel/notifier.c:337 [inline] blocking_notifier_call_chain+0x67/0x90 kernel/notifier.c:325 netlink_release+0xc56/0x1cf0 net/netlink/af_netlink.c:785 __sock_release+0xcd/0x280 net/socket.c:647 sock_close+0x18/0x20 net/socket.c:1293 __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 Second to last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xa4/0xd0 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x8c0 kernel/rcu/tree.c:3597 cfg80211_update_known_bss+0x833/0xa60 net/wireless/scan.c:1661 cfg80211_bss_update+0xef/0x1e00 net/wireless/scan.c:1708 cfg80211_inform_single_bss_frame_data+0x6e2/0xee0 net/wireless/scan.c:2414 cfg80211_inform_bss_frame_data+0xa7/0xb10 net/wireless/scan.c:2447 ieee80211_bss_info_update+0x3ce/0xb60 net/mac80211/scan.c:190 ieee80211_rx_bss_info net/mac80211/ibss.c:1126 [inline] ieee80211_rx_mgmt_probe_beacon+0xcfe/0x17b0 net/mac80211/ibss.c:1615 ieee80211_ibss_rx_queued_mgmt+0xd82/0x15f0 net/mac80211/ibss.c:1642 ieee80211_iface_process_skb net/mac80211/iface.c:1426 [inline] ieee80211_iface_work+0x7f7/0xa40 net/mac80211/iface.c:1462 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 The buggy address belongs to the object at ffff88801e691700 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 28 bytes inside of 96-byte region [ffff88801e691700, ffff88801e691760) The buggy address belongs to the page: page:ffffea000079a440 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801e691680 pfn:0x1e691 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001824748 ffffea0001821cc8 ffff888011040300 raw: ffff88801e691680 ffff88801e691000 000000010000001c 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 8479, ts 108957942797, free_ts 108957544791 prep_new_page mm/page_alloc.c:2445 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4178 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5386 __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] __do_kmalloc mm/slab.c:3700 [inline] __kmalloc+0x3eb/0x4d0 mm/slab.c:3711 kmalloc_array+0x42/0x70 include/linux/slab.h:631 kcalloc include/linux/slab.h:660 [inline] ext4_find_extent+0x984/0xce0 fs/ext4/extents.c:864 ext4_ext_map_blocks+0x1e2/0x6060 fs/ext4/extents.c:4061 ext4_map_blocks+0x9a8/0x17d0 fs/ext4/inode.c:563 ext4_getblk+0x13c/0x680 fs/ext4/inode.c:848 ext4_bread+0x2a/0x1c0 fs/ext4/inode.c:900 ext4_append+0x177/0x390 fs/ext4/namei.c:67 ext4_init_new_dir+0x33f/0x5e0 fs/ext4/namei.c:2885 ext4_mkdir+0x3cf/0xb20 fs/ext4/namei.c:2931 vfs_mkdir+0x538/0x770 fs/namei.c:3813 do_mkdirat+0x284/0x310 fs/namei.c:3838 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1355 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3341 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3420 pte_free include/asm-generic/pgalloc.h:102 [inline] do_fault mm/memory.c:4169 [inline] handle_pte_fault mm/memory.c:4420 [inline] __handle_mm_fault+0x190c/0x5320 mm/memory.c:4555 handle_mm_fault+0x1c8/0x7f0 mm/memory.c:4653 do_user_addr_fault+0x483/0x1210 arch/x86/mm/fault.c:1390 handle_page_fault arch/x86/mm/fault.c:1475 [inline] exc_page_fault+0x9e/0x180 arch/x86/mm/fault.c:1531 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:568 Memory state around the buggy address: ffff88801e691600: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88801e691680: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff88801e691700: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88801e691780: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88801e691800: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ==================================================================