All of lore.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+b2e951687503f32f74ce@syzkaller.appspotmail.com>
To: hdanton@sina.com, linux-kernel@vger.kernel.org,
	 syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [dri?] KASAN: slab-use-after-free Read in drm_gem_object_release_handle
Date: Wed, 15 Apr 2026 21:52:03 -0700	[thread overview]
Message-ID: <69e06af3.a70a0220.259bc5.0017.GAE@google.com> (raw)
In-Reply-To: <20260416004433.1922-1-hdanton@sina.com>

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: slab-use-after-free Read in drm_gem_object_release_handle

==================================================================
BUG: KASAN: slab-use-after-free in drm_gem_object_release_handle+0x47/0x1e0 drivers/gpu/drm/drm_gem.c:374
Read of size 8 at addr ffff888035e4c278 by task syz.1.169/7028

CPU: 1 UID: 0 PID: 7028 Comm: syz.1.169 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 print_address_description+0x55/0x1e0 mm/kasan/report.c:378
 print_report+0x58/0x70 mm/kasan/report.c:482
 kasan_report+0x117/0x150 mm/kasan/report.c:595
 drm_gem_object_release_handle+0x47/0x1e0 drivers/gpu/drm/drm_gem.c:374
 drm_gem_release+0xe8/0x190 drivers/gpu/drm/drm_gem.c:1118
 drm_file_free+0x729/0xa00 drivers/gpu/drm/drm_file.c:261
 drm_close_helper drivers/gpu/drm/drm_file.c:290 [inline]
 drm_release+0x2de/0x3f0 drivers/gpu/drm/drm_file.c:438
 __fput+0x44f/0xa60 fs/file_table.c:510
 task_work_run+0x1d9/0x270 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:67 [inline]
 exit_to_user_mode_loop+0xed/0x480 kernel/entry/common.c:98
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:238 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:328 [inline]
 do_syscall_64+0x33e/0xf80 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f4a7e79c819
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd28753448 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007ffd28753530 RCX: 00007f4a7e79c819
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 000000000001f80f R08: 0000000000000001 R09: 0000000000000000
R10: 0000001b30a20000 R11: 0000000000000246 R12: 00007ffd28753570
R13: 00007f4a7ea1609c R14: 000000000001f863 R15: 00007f4a7ea16090
 </TASK>

Allocated by task 7032:
 kasan_save_stack mm/kasan/common.c:57 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
 poison_kmalloc_redzone mm/kasan/common.c:398 [inline]
 __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:415
 kasan_kmalloc include/linux/kasan.h:263 [inline]
 __kmalloc_cache_noprof+0x31c/0x660 mm/slub.c:5415
 kmalloc_noprof include/linux/slab.h:950 [inline]
 kzalloc_noprof include/linux/slab.h:1188 [inline]
 __drm_gem_shmem_create+0xc4/0x2e0 drivers/gpu/drm/drm_gem_shmem_helper.c:130
 drm_gem_shmem_create drivers/gpu/drm/drm_gem_shmem_helper.c:157 [inline]
 drm_gem_shmem_create_with_handle drivers/gpu/drm/drm_gem_shmem_helper.c:464 [inline]
 drm_gem_shmem_dumb_create+0x72/0x120 drivers/gpu/drm/drm_gem_shmem_helper.c:553
 drm_mode_create_dumb drivers/gpu/drm/drm_dumb_buffers.c:227 [inline]
 drm_mode_create_dumb_ioctl+0x2bd/0x340 drivers/gpu/drm/drm_dumb_buffers.c:236
 drm_ioctl_kernel+0x2df/0x3b0 drivers/gpu/drm/drm_ioctl.c:804
 drm_ioctl+0x6ba/0xb80 drivers/gpu/drm/drm_ioctl.c:901
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 7033:
 kasan_save_stack mm/kasan/common.c:57 [inline]
 kasan_save_track+0x3e/0x80 mm/kasan/common.c:78
 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584
 poison_slab_object mm/kasan/common.c:253 [inline]
 __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285
 kasan_slab_free include/linux/kasan.h:235 [inline]
 slab_free_hook mm/slub.c:2689 [inline]
 slab_free mm/slub.c:6246 [inline]
 kfree+0x1c5/0x640 mm/slub.c:6561
 drm_gem_handle_delete+0xa3/0xc0 drivers/gpu/drm/drm_gem.c:416
 drm_ioctl_kernel+0x2df/0x3b0 drivers/gpu/drm/drm_ioctl.c:804
 drm_ioctl+0x6ba/0xb80 drivers/gpu/drm/drm_ioctl.c:901
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff888035e4c000
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 632 bytes inside of
 freed 1024-byte region [ffff888035e4c000, ffff888035e4c400)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x35e48
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88813fe29dc0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88813fe29dc0 dead000000000100 dead000000000122
head: 0000000000000000 0000000800100010 00000000f5000000 0000000000000000
head: 00fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 129, tgid 129 (kworker/u8:6), ts 129037001160, free_ts 129034880394
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x231/0x280 mm/page_alloc.c:1860
 prep_new_page mm/page_alloc.c:1868 [inline]
 get_page_from_freelist+0x24ba/0x2540 mm/page_alloc.c:3948
 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5228
 alloc_slab_page mm/slub.c:3278 [inline]
 allocate_slab+0x77/0x660 mm/slub.c:3467
 new_slab mm/slub.c:3525 [inline]
 refill_objects+0x339/0x3d0 mm/slub.c:7251
 refill_sheaf mm/slub.c:2816 [inline]
 __pcs_replace_empty_main+0x321/0x720 mm/slub.c:4651
 alloc_from_pcs mm/slub.c:4749 [inline]
 slab_alloc_node mm/slub.c:4883 [inline]
 __do_kmalloc_node mm/slub.c:5294 [inline]
 __kmalloc_noprof+0x474/0x760 mm/slub.c:5307
 kmalloc_noprof include/linux/slab.h:954 [inline]
 kzalloc_noprof include/linux/slab.h:1188 [inline]
 ieee802_11_parse_elems_full+0x159/0x2ab0 net/mac80211/parse.c:1051
 ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2518 [inline]
 ieee80211_inform_bss+0x161/0x1160 net/mac80211/scan.c:79
 rdev_inform_bss net/wireless/rdev-ops.h:418 [inline]
 cfg80211_inform_single_bss_data+0xcf9/0x1af0 net/wireless/scan.c:2372
 cfg80211_inform_bss_data+0x266/0x3c40 net/wireless/scan.c:3226
 cfg80211_inform_bss_frame_data+0x3c7/0x730 net/wireless/scan.c:3317
 ieee80211_bss_info_update+0x794/0xa40 net/mac80211/scan.c:230
 ieee80211_rx_bss_info net/mac80211/ibss.c:1088 [inline]
 ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1569 [inline]
 ieee80211_ibss_rx_queued_mgmt+0x1901/0x2cb0 net/mac80211/ibss.c:1596
 ieee80211_iface_process_skb net/mac80211/iface.c:1795 [inline]
 ieee80211_iface_work+0x845/0x1380 net/mac80211/iface.c:1849
 cfg80211_wiphy_work+0x2cf/0x460 net/wireless/core.c:513
page last free pid 7008 tgid 7008 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 __free_pages_prepare mm/page_alloc.c:1404 [inline]
 __free_frozen_pages+0xbc7/0xd30 mm/page_alloc.c:2945
 __slab_free+0x274/0x2c0 mm/slub.c:5608
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x99/0x100 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:350
 kasan_slab_alloc include/linux/kasan.h:253 [inline]
 slab_post_alloc_hook mm/slub.c:4569 [inline]
 slab_alloc_node mm/slub.c:4898 [inline]
 kmem_cache_alloc_noprof+0x2bc/0x650 mm/slub.c:4905
 alloc_filename fs/namei.c:142 [inline]
 do_getname+0x2e/0x250 fs/namei.c:182
 getname include/linux/fs.h:2533 [inline]
 getname_maybe_null include/linux/fs.h:2540 [inline]
 class_filename_maybe_null_constructor include/linux/fs.h:2564 [inline]
 vfs_fstatat+0x45/0x170 fs/stat.c:368
 __do_sys_newfstatat fs/stat.c:538 [inline]
 __se_sys_newfstatat fs/stat.c:532 [inline]
 __x64_sys_newfstatat+0x151/0x200 fs/stat.c:532
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff888035e4c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888035e4c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888035e4c200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                                ^
 ffff888035e4c280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888035e4c300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


Tested on:

commit:         1d51b370 Merge tag 'jfs-7.1' of github.com:kleikamp/li..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=125881ba580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=769ed9499e4e3d7d
dashboard link: https://syzkaller.appspot.com/bug?extid=b2e951687503f32f74ce
compiler:       Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
patch:          https://syzkaller.appspot.com/x/patch.diff?x=17f344ce580000


  reply	other threads:[~2026-04-16  4:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13 17:16 [syzbot] [dri?] KASAN: slab-use-after-free Read in drm_gem_object_release_handle syzbot
2026-04-14  0:16 ` Forwarded: [PATCH] drm/gem: fix use-after-free in drm_gem_release syzbot
2026-04-14  1:32 ` syzbot
2026-04-14  5:00 ` [syzbot] [dri?] KASAN: slab-use-after-free Read in drm_gem_object_release_handle Hillf Danton
2026-04-14  5:26   ` syzbot
2026-04-14  5:49 ` Forwarded: [PATCH] drm/gem: fix use-after-free in drm_gem_release syzbot
2026-04-14  8:46 ` [syzbot] [dri?] KASAN: slab-use-after-free Read in drm_gem_object_release_handle Hillf Danton
2026-04-14  9:04   ` syzbot
2026-04-14 10:03 ` Hillf Danton
2026-04-14 10:20   ` syzbot
2026-04-15  0:33 ` Hillf Danton
2026-04-15  3:54   ` syzbot
2026-04-15  7:50 ` Hillf Danton
2026-04-15  8:50   ` syzbot
2026-04-15 11:19 ` Hillf Danton
2026-04-15 11:44   ` syzbot
2026-04-16  0:44 ` Hillf Danton
2026-04-16  4:52   ` syzbot [this message]
2026-04-16  2:59 ` Edward Adam Davis
2026-04-16  5:13   ` syzbot
2026-04-16  8:19 ` Hillf Danton
2026-04-16  9:03   ` syzbot
2026-04-16  8:57 ` [PATCH] drm: Avoid the chaotic interleaving of change and delete handle Edward Adam Davis
     [not found] <20260414001626.60471-1-kartikey406@gmail.com>
2026-04-14  0:36 ` [syzbot] [dri?] KASAN: slab-use-after-free Read in drm_gem_object_release_handle syzbot
     [not found] <20260414013225.64095-1-kartikey406@gmail.com>
2026-04-14  1:50 ` syzbot
     [not found] <20260414054951.69728-1-kartikey406@gmail.com>
2026-04-14  6:22 ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69e06af3.a70a0220.259bc5.0017.GAE@google.com \
    --to=syzbot+b2e951687503f32f74ce@syzkaller.appspotmail.com \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.