================================================================== BUG: KASAN: slab-use-after-free in drm_atomic_helper_wait_for_vblanks.part.0+0x7d5/0x8a0 drivers/gpu/drm/drm_atomic_helper.c:1905 Read of size 1 at addr ffff88802ecd4009 by task kworker/u33:6/204 CPU: 0 UID: 0 PID: 204 Comm: kworker/u33:6 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: events_unbound commit_work Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 drm_atomic_helper_wait_for_vblanks.part.0+0x7d5/0x8a0 drivers/gpu/drm/drm_atomic_helper.c:1905 drm_atomic_helper_wait_for_vblanks drivers/gpu/drm/drm_atomic_helper.c:1901 [inline] drm_atomic_helper_commit_tail+0xff/0x130 drivers/gpu/drm/drm_atomic_helper.c:2003 commit_tail+0x338/0x430 drivers/gpu/drm/drm_atomic_helper.c:2080 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 14702: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __kmalloc_cache_noprof+0x2f8/0x6d0 mm/slub.c:5563 _kmalloc_noprof include/linux/slab.h:991 [inline] drm_atomic_helper_crtc_duplicate_state+0x72/0xd0 drivers/gpu/drm/drm_atomic_state_helper.c:204 drm_atomic_get_crtc_state+0x1de/0x690 drivers/gpu/drm/drm_atomic.c:462 drm_atomic_set_property+0x165/0x3f90 drivers/gpu/drm/drm_atomic_uapi.c:1244 drm_mode_atomic_ioctl+0x6ed/0x27c0 drivers/gpu/drm/drm_atomic_uapi.c:1737 drm_ioctl_kernel+0x1f3/0x3e0 drivers/gpu/drm/drm_ioctl.c:817 drm_ioctl+0x5e6/0xc60 drivers/gpu/drm/drm_ioctl.c:914 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 1015: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2748 [inline] slab_free mm/slub.c:6499 [inline] kfree+0x22b/0x6d0 mm/slub.c:6792 drm_atomic_commit_default_clear+0x465/0x10c0 drivers/gpu/drm/drm_atomic.c:311 drm_atomic_commit_clear drivers/gpu/drm/drm_atomic.c:394 [inline] __drm_atomic_commit_free+0x185/0x2f0 drivers/gpu/drm/drm_atomic.c:411 kref_put include/linux/kref.h:65 [inline] drm_atomic_commit_put include/drm/drm_atomic.h:713 [inline] drm_atomic_helper_dirtyfb+0x578/0x790 drivers/gpu/drm/drm_damage_helper.c:195 drm_fbdev_shmem_helper_fb_dirty+0x1cc/0x350 drivers/gpu/drm/drm_fbdev_shmem.c:117 drm_fb_helper_fb_dirty drivers/gpu/drm/drm_fb_helper.c:339 [inline] drm_fb_helper_damage_work+0x4c8/0xab0 drivers/gpu/drm/drm_fb_helper.c:365 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88802ecd4000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 9 bytes inside of freed 512-byte region [ffff88802ecd4000, ffff88802ecd4200) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88802ecd5000 pfn:0x2ecd4 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801c042c80 ffffea00015e6210 ffffea00015e2910 raw: ffff88802ecd5000 000000000010000b 00000000f5000000 0000000000000000 head: 00fff00000000240 ffff88801c042c80 ffffea00015e6210 ffffea00015e2910 head: ffff88802ecd5000 000000000010000b 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffffffffffff01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5731, tgid 5731 (syz-executor), ts 48423218570 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x110d/0x35d0 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x2eb/0x3300 mm/page_alloc.c:5436 alloc_slab_page mm/slub.c:3347 [inline] allocate_slab mm/slub.c:3462 [inline] new_slab+0xa9/0x6e0 mm/slub.c:3513 refill_objects+0xe3/0x410 mm/slub.c:7410 refill_sheaf mm/slub.c:2885 [inline] __pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774 alloc_from_pcs mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:4984 [inline] __do_kmalloc_node mm/slub.c:5413 [inline] __kmalloc_noprof+0x67c/0x840 mm/slub.c:5439 _kmalloc_noprof include/linux/slab.h:995 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] fib6_info_alloc+0x40/0x160 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x14c/0xad0 net/ipv6/route.c:3833 ip6_route_add+0x4b/0x1d0 net/ipv6/route.c:3962 addrconf_add_mroute+0x1de/0x350 net/ipv6/addrconf.c:2568 addrconf_add_dev+0x14e/0x1a0 net/ipv6/addrconf.c:2586 inet6_addr_add+0xfc/0x9a0 net/ipv6/addrconf.c:3056 inet6_rtm_newaddr+0x147a/0x1bb0 net/ipv6/addrconf.c:5095 rtnetlink_rcv_msg+0x95e/0xe90 net/core/rtnetlink.c:7132 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2556 page last free pid 1015 tgid 1015 ts 48408689190 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1418 [inline] __free_frozen_pages+0x79f/0x10f0 mm/page_alloc.c:2962 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4683 [inline] slab_alloc_node mm/slub.c:4996 [inline] kmem_cache_alloc_node_noprof+0x282/0x6e0 mm/slub.c:5068 __alloc_skb+0x140/0x710 net/core/skbuff.c:704 alloc_skb include/linux/skbuff.h:1384 [inline] mld_newpack.isra.0+0x18e/0xa20 net/ipv6/mcast.c:1810 add_grhead+0x299/0x340 net/ipv6/mcast.c:1921 add_grec+0x1389/0x1930 net/ipv6/mcast.c:2060 mld_send_cr net/ipv6/mcast.c:2185 [inline] mld_ifc_work+0x3c5/0xc10 net/ipv6/mcast.c:2739 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff88802ecd3f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802ecd3f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88802ecd4000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802ecd4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802ecd4100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================