================================================================== 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 ffff888049c2371c by task syz-executor.3/11554 CPU: 0 PID: 11554 Comm: syz-executor.3 Not tainted 5.13.0-rc2-next-20210518-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+0x13e/0x1d6 lib/dump_stack.c:129 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 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_64+0x31/0xb0 arch/x86/entry/common.c:47 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:00007f9e662fd188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665d9 RDX: 0000000020000080 RSI: 0000000000004601 RDI: 0000000000000003 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffe8fa9d09f R14: 00007f9e662fd300 R15: 0000000000022000 Allocated by task 27921: 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:431 [inline] ____kasan_kmalloc mm/kasan/common.c:510 [inline] ____kasan_kmalloc mm/kasan/common.c:469 [inline] __kasan_kmalloc+0x9b/0xd0 mm/kasan/common.c:519 kmalloc include/linux/slab.h:590 [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_64+0x31/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 11337: 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:357 ____kasan_slab_free mm/kasan/common.c:363 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xfb/0x130 mm/kasan/common.c:371 kasan_slab_free include/linux/kasan.h:212 [inline] slab_free_hook mm/slub.c:1623 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1648 slab_free mm/slub.c:3208 [inline] kfree+0xeb/0x650 mm/slub.c:4274 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_64+0x31/0xb0 arch/x86/entry/common.c:47 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+0xe5/0x110 mm/kasan/generic.c:345 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3594 cfg80211_update_known_bss+0x833/0xa60 net/wireless/scan.c:1651 cfg80211_bss_update+0xef/0x1e10 net/wireless/scan.c:1698 cfg80211_inform_single_bss_frame_data+0x6e8/0xee0 net/wireless/scan.c:2404 cfg80211_inform_bss_frame_data+0xa7/0xb10 net/wireless/scan.c:2437 ieee80211_bss_info_update+0x374/0xb30 net/mac80211/scan.c:190 ieee80211_rx_bss_info net/mac80211/ibss.c:1126 [inline] ieee80211_rx_mgmt_probe_beacon+0xc95/0x16c0 net/mac80211/ibss.c:1615 ieee80211_ibss_rx_queued_mgmt+0xd30/0x1610 net/mac80211/ibss.c:1642 ieee80211_iface_work+0x761/0x9e0 net/mac80211/iface.c:1437 process_one_work+0x98d/0x1600 kernel/workqueue.c:2275 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421 kthread+0x3b1/0x4a0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Second to last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:345 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3594 cfg80211_update_known_bss+0x833/0xa60 net/wireless/scan.c:1651 cfg80211_bss_update+0xef/0x1e10 net/wireless/scan.c:1698 cfg80211_inform_single_bss_frame_data+0x6e8/0xee0 net/wireless/scan.c:2404 cfg80211_inform_bss_frame_data+0xa7/0xb10 net/wireless/scan.c:2437 ieee80211_bss_info_update+0x374/0xb30 net/mac80211/scan.c:190 ieee80211_rx_bss_info net/mac80211/ibss.c:1126 [inline] ieee80211_rx_mgmt_probe_beacon+0xc95/0x16c0 net/mac80211/ibss.c:1615 ieee80211_ibss_rx_queued_mgmt+0xd30/0x1610 net/mac80211/ibss.c:1642 ieee80211_iface_work+0x761/0x9e0 net/mac80211/iface.c:1437 process_one_work+0x98d/0x1600 kernel/workqueue.c:2275 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421 kthread+0x3b1/0x4a0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the object at ffff888049c23700 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 28 bytes inside of 96-byte region [ffff888049c23700, ffff888049c23760) The buggy address belongs to the page: page:ffffea00012708c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888049c23580 pfn:0x49c23 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000062b1c8 ffffea00009dd848 ffff888011041780 raw: ffff888049c23580 000000000020000b 00000001ffffffff 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 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 9582, ts 93991672193, free_ts 93817191228 prep_new_page mm/page_alloc.c:2377 [inline] get_page_from_freelist+0x125c/0x2ed0 mm/page_alloc.c:4038 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5239 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2272 alloc_slab_page mm/slub.c:1686 [inline] allocate_slab+0x2c2/0x4c0 mm/slub.c:1826 new_slab mm/slub.c:1889 [inline] new_slab_objects mm/slub.c:2635 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2798 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2838 slab_alloc_node mm/slub.c:2920 [inline] slab_alloc mm/slub.c:2962 [inline] kmem_cache_alloc_trace+0x30f/0x3c0 mm/slub.c:2979 kmalloc include/linux/slab.h:590 [inline] dst_cow_metrics_generic+0x48/0x1e0 net/core/dst.c:201 dst_metrics_write_ptr include/net/dst.h:118 [inline] dst_metric_set include/net/dst.h:179 [inline] icmp6_dst_alloc+0x4f5/0x6c0 net/ipv6/route.c:3164 mld_sendpack+0x586/0xdc0 net/ipv6/mcast.c:1809 mld_send_initial_cr.part.0+0x194/0x230 net/ipv6/mcast.c:2239 mld_send_initial_cr net/ipv6/mcast.c:1227 [inline] ipv6_mc_dad_complete+0x1d0/0x690 net/ipv6/mcast.c:2247 addrconf_dad_completed+0xa20/0xd60 net/ipv6/addrconf.c:4175 addrconf_dad_work+0x79f/0x1340 net/ipv6/addrconf.c:4105 process_one_work+0x98d/0x1600 kernel/workqueue.c:2275 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1305 [inline] free_pcp_prepare+0x217/0x300 mm/page_alloc.c:1349 free_unref_page_prepare mm/page_alloc.c:3272 [inline] free_unref_page+0x16/0x630 mm/page_alloc.c:3303 tlb_batch_list_free mm/mmu_gather.c:61 [inline] tlb_finish_mmu+0x24f/0x8c0 mm/mmu_gather.c:343 exit_mmap+0x1ea/0x620 mm/mmap.c:3203 __mmput+0x122/0x470 kernel/fork.c:1096 mmput+0x58/0x60 kernel/fork.c:1117 exit_mm kernel/exit.c:502 [inline] do_exit+0xb0a/0x2a70 kernel/exit.c:813 do_group_exit+0x125/0x310 kernel/exit.c:923 get_signal+0x47f/0x2150 kernel/signal.c:2856 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:789 handle_signal_work kernel/entry/common.c:147 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x16e/0x280 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301 do_syscall_64+0x3e/0xb0 arch/x86/entry/common.c:57 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888049c23600: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888049c23680: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff888049c23700: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888049c23780: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888049c23800: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ==================================================================