================================================================== BUG: KASAN: use-after-free in fb_mode_is_equal+0x36e/0x5e0 drivers/video/fbdev/core/modedb.c:924 Read of size 4 at addr ffff88802b00b79c by task syz-executor.0/14932 CPU: 0 PID: 14932 Comm: syz-executor.0 Not tainted 5.13.0-rc3-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+0x202/0x31e lib/dump_stack.c:120 print_address_description+0x5f/0x3b0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x15c/0x200 mm/kasan/report.c:436 fb_mode_is_equal+0x36e/0x5e0 drivers/video/fbdev/core/modedb.c:924 fbcon_mode_deleted+0x16b/0x220 drivers/video/fbdev/core/fbcon.c:2718 fb_set_var+0x241/0xdf0 drivers/video/fbdev/core/fbmem.c:975 do_fb_ioctl+0x586/0x7e0 drivers/video/fbdev/core/fbmem.c:1108 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:1055 do_syscall_64+0x3f/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:00007f8dc2017188 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: 00007ffd26cfb87f R14: 00007f8dc2017300 R15: 0000000000022000 Allocated by task 17508: 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:428 [inline] ____kasan_kmalloc+0xc4/0xf0 mm/kasan/common.c:507 kasan_kmalloc include/linux/kasan.h:246 [inline] kmem_cache_alloc_trace+0x96/0x340 mm/slub.c:2940 kmalloc include/linux/slab.h:556 [inline] fb_add_videomode+0x6f9/0x800 drivers/video/fbdev/core/modedb.c:1073 fb_set_var+0x811/0xdf0 drivers/video/fbdev/core/fbmem.c:1049 do_fb_ioctl+0x586/0x7e0 drivers/video/fbdev/core/fbmem.c:1108 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:1055 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 14808: 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:357 ____kasan_slab_free+0x109/0x150 mm/kasan/common.c:360 kasan_slab_free include/linux/kasan.h:212 [inline] slab_free_hook mm/slub.c:1582 [inline] slab_free_freelist_hook+0x1d8/0x290 mm/slub.c:1607 slab_free mm/slub.c:3167 [inline] kfree+0xcf/0x2d0 mm/slub.c:4217 fb_delete_videomode+0x56a/0x820 drivers/video/fbdev/core/modedb.c:1104 fb_set_var+0x253/0xdf0 drivers/video/fbdev/core/fbmem.c:978 do_fb_ioctl+0x586/0x7e0 drivers/video/fbdev/core/fbmem.c:1108 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:1055 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 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:345 kvfree_call_rcu+0x114/0x7a0 kernel/rcu/tree.c:3597 cfg80211_update_known_bss+0x174/0x9a0 net/wireless/scan.c:1608 cfg80211_bss_update+0x169/0x1ea0 net/wireless/scan.c:1698 cfg80211_inform_single_bss_frame_data net/wireless/scan.c:2404 [inline] cfg80211_inform_bss_frame_data+0x861/0x1e10 net/wireless/scan.c:2437 ieee80211_bss_info_update+0x74e/0xbd0 net/mac80211/scan.c:190 ieee80211_rx_bss_info net/mac80211/ibss.c:1126 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1615 [inline] ieee80211_ibss_rx_queued_mgmt+0x16ae/0x2ac0 net/mac80211/ibss.c:1642 ieee80211_iface_work+0x708/0xb00 net/mac80211/iface.c:1437 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1300 kernel/workqueue.c:2422 kthread+0x39a/0x3c0 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+0x27/0x50 mm/kasan/common.c:38 kasan_record_aux_stack+0xee/0x120 mm/kasan/generic.c:345 kvfree_call_rcu+0x114/0x7a0 kernel/rcu/tree.c:3597 cfg80211_update_known_bss+0x174/0x9a0 net/wireless/scan.c:1608 cfg80211_bss_update+0x169/0x1ea0 net/wireless/scan.c:1698 cfg80211_inform_single_bss_frame_data net/wireless/scan.c:2404 [inline] cfg80211_inform_bss_frame_data+0x861/0x1e10 net/wireless/scan.c:2437 ieee80211_bss_info_update+0x74e/0xbd0 net/mac80211/scan.c:190 ieee80211_rx_bss_info net/mac80211/ibss.c:1126 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1615 [inline] ieee80211_ibss_rx_queued_mgmt+0x16ae/0x2ac0 net/mac80211/ibss.c:1642 ieee80211_iface_work+0x708/0xb00 net/mac80211/iface.c:1437 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1300 kernel/workqueue.c:2422 kthread+0x39a/0x3c0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the object at ffff88802b00b780 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 28 bytes inside of 96-byte region [ffff88802b00b780, ffff88802b00b7e0) The buggy address belongs to the page: page:ffffea0000ac02c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2b00b flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000665e80 0000001000000002 ffff888011841780 raw: 0000000000000000 0000000000200020 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 0x12c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY), pid 8461, ts 155384291583, free_ts 155379655747 prep_new_page mm/page_alloc.c:2358 [inline] get_page_from_freelist+0x779/0xa20 mm/page_alloc.c:3994 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5200 alloc_slab_page mm/slub.c:1645 [inline] allocate_slab+0xf1/0x5b0 mm/slub.c:1785 new_slab mm/slub.c:1848 [inline] new_slab_objects mm/slub.c:2594 [inline] ___slab_alloc+0x1cf/0x350 mm/slub.c:2757 __slab_alloc mm/slub.c:2797 [inline] slab_alloc_node mm/slub.c:2879 [inline] slab_alloc mm/slub.c:2921 [inline] __kmalloc+0x2ed/0x390 mm/slub.c:4055 kmalloc include/linux/slab.h:561 [inline] kzalloc include/linux/slab.h:686 [inline] tomoyo_commit_ok+0x24/0x1c0 security/tomoyo/memory.c:76 tomoyo_update_domain+0x565/0x8b0 security/tomoyo/domain.c:139 tomoyo_update_path_number_acl security/tomoyo/file.c:691 [inline] tomoyo_write_file+0x805/0x10e0 security/tomoyo/file.c:1034 tomoyo_write_domain2 security/tomoyo/common.c:1152 [inline] tomoyo_add_entry security/tomoyo/common.c:2042 [inline] tomoyo_supervisor+0x1160/0x1460 security/tomoyo/common.c:2103 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x533/0x790 security/tomoyo/file.c:734 security_file_ioctl+0x55/0xb0 security/security.c:1539 __do_sys_ioctl fs/ioctl.c:1063 [inline] __se_sys_ioctl+0x48/0x170 fs/ioctl.c:1055 do_syscall_64+0x3f/0xb0 arch/x86/entry/common.c:47 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:1298 [inline] free_pcp_prepare+0x3ea/0x420 mm/page_alloc.c:1342 free_unref_page_prepare mm/page_alloc.c:3250 [inline] free_unref_page+0x7b/0x280 mm/page_alloc.c:3298 __vunmap+0x926/0xa60 mm/vmalloc.c:2566 free_work+0x66/0x90 mm/vmalloc.c:80 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1300 kernel/workqueue.c:2422 kthread+0x39a/0x3c0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Memory state around the buggy address: ffff88802b00b680: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff88802b00b700: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc >ffff88802b00b780: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88802b00b800: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88802b00b880: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ==================================================================