* [syzbot] [dri?] memory leak in drm_mode_atomic_ioctl
@ 2025-12-04 14:25 syzbot
2025-12-04 15:57 ` shaurya
0 siblings, 1 reply; 3+ messages in thread
From: syzbot @ 2025-12-04 14:25 UTC (permalink / raw)
To: airlied, dri-devel, linux-kernel, maarten.lankhorst, mripard,
simona, syzkaller-bugs, tzimmermann
Hello,
syzbot found the following issue on:
HEAD commit: 6bda50f4333f Merge tag 'mips-fixes_6.18_2' of git://git.ke..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17ab8512580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f30cc590c4f6da44
dashboard link: https://syzkaller.appspot.com/bug?extid=3fc9eecaf97147282c87
compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14447cb4580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1094d508580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/864951cecf67/disk-6bda50f4.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4692a21b76e7/vmlinux-6bda50f4.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a2898beb8301/bzImage-6bda50f4.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+3fc9eecaf97147282c87@syzkaller.appspotmail.com
BUG: memory leak
unreferenced object 0xffff888125711880 (size 128):
comm "syz.0.18", pid 6089, jiffies 4294942955
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc f5a89fc0):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4983 [inline]
slab_alloc_node mm/slub.c:5288 [inline]
__kmalloc_cache_noprof+0x3a6/0x5b0 mm/slub.c:5766
kmalloc_noprof include/linux/slab.h:957 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
create_vblank_event drivers/gpu/drm/drm_atomic_uapi.c:931 [inline]
prepare_signaling drivers/gpu/drm/drm_atomic_uapi.c:1221 [inline]
drm_mode_atomic_ioctl+0x924/0x13d0 drivers/gpu/drm/drm_atomic_uapi.c:1529
drm_ioctl_kernel+0x125/0x1f0 drivers/gpu/drm/drm_ioctl.c:797
drm_ioctl+0x371/0x6b0 drivers/gpu/drm/drm_ioctl.c:894
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+0xf4/0x140 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
BUG: memory leak
unreferenced object 0xffff888125711780 (size 128):
comm "syz.0.19", pid 6092, jiffies 4294942957
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc f5a89fc0):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4983 [inline]
slab_alloc_node mm/slub.c:5288 [inline]
__kmalloc_cache_noprof+0x3a6/0x5b0 mm/slub.c:5766
kmalloc_noprof include/linux/slab.h:957 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
create_vblank_event drivers/gpu/drm/drm_atomic_uapi.c:931 [inline]
prepare_signaling drivers/gpu/drm/drm_atomic_uapi.c:1221 [inline]
drm_mode_atomic_ioctl+0x924/0x13d0 drivers/gpu/drm/drm_atomic_uapi.c:1529
drm_ioctl_kernel+0x125/0x1f0 drivers/gpu/drm/drm_ioctl.c:797
drm_ioctl+0x371/0x6b0 drivers/gpu/drm/drm_ioctl.c:894
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+0xf4/0x140 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
BUG: memory leak
unreferenced object 0xffff888125711700 (size 128):
comm "syz.0.20", pid 6121, jiffies 4294943534
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc f5a89fc0):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4983 [inline]
slab_alloc_node mm/slub.c:5288 [inline]
__kmalloc_cache_noprof+0x3a6/0x5b0 mm/slub.c:5766
kmalloc_noprof include/linux/slab.h:957 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
create_vblank_event drivers/gpu/drm/drm_atomic_uapi.c:931 [inline]
prepare_signaling drivers/gpu/drm/drm_atomic_uapi.c:1221 [inline]
drm_mode_atomic_ioctl+0x924/0x13d0 drivers/gpu/drm/drm_atomic_uapi.c:1529
drm_ioctl_kernel+0x125/0x1f0 drivers/gpu/drm/drm_ioctl.c:797
drm_ioctl+0x371/0x6b0 drivers/gpu/drm/drm_ioctl.c:894
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+0xf4/0x140 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
BUG: memory leak
unreferenced object 0xffff8881266fab80 (size 128):
comm "syz.0.21", pid 6122, jiffies 4294943536
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc f5a89fc0):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4983 [inline]
slab_alloc_node mm/slub.c:5288 [inline]
__kmalloc_cache_noprof+0x3a6/0x5b0 mm/slub.c:5766
kmalloc_noprof include/linux/slab.h:957 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
create_vblank_event drivers/gpu/drm/drm_atomic_uapi.c:931 [inline]
prepare_signaling drivers/gpu/drm/drm_atomic_uapi.c:1221 [inline]
drm_mode_atomic_ioctl+0x924/0x13d0 drivers/gpu/drm/drm_atomic_uapi.c:1529
drm_ioctl_kernel+0x125/0x1f0 drivers/gpu/drm/drm_ioctl.c:797
drm_ioctl+0x371/0x6b0 drivers/gpu/drm/drm_ioctl.c:894
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+0xf4/0x140 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
connection error: failed to recv *flatrpc.ExecutorMessageRawT: EOF
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [syzbot] [dri?] memory leak in drm_mode_atomic_ioctl
2025-12-04 14:25 [syzbot] [dri?] memory leak in drm_mode_atomic_ioctl syzbot
@ 2025-12-04 15:57 ` shaurya
2025-12-04 16:47 ` syzbot
0 siblings, 1 reply; 3+ messages in thread
From: shaurya @ 2025-12-04 15:57 UTC (permalink / raw)
To: syzbot+3fc9eecaf97147282c87; +Cc: linux-kernel, syzkaller-bugs
[-- Attachment #1: Type: text/plain, Size: 83 bytes --]
#syz test:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
[-- Attachment #2: 0001-drm-atomic-fix-memory-leak-in-prepare_signaling-erro.patch --]
[-- Type: text/x-patch, Size: 1287 bytes --]
From 54d892b20a412a204d890e4a1d0e3632ab7ec787 Mon Sep 17 00:00:00 2001
From: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
Date: Thu, 4 Dec 2025 21:10:48 +0530
Subject: [PATCH] drm/atomic: fix memory leak in prepare_signaling() error path
When prepare_signaling() creates a vblank event for an out-fence but
fails before attaching the fence (e.g., krealloc or drm_crtc_create_fence
fails), complete_signaling() only frees events with fence or file_priv
set, leaking the partially initialized event.
Add an else branch to kfree events that have neither fence nor file_priv.
Reported-by: syzbot+3fc9eecaf97147282c87@syzkaller.appspotmail.com
Signed-off-by: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
---
drivers/gpu/drm/drm_atomic_uapi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 85dbdaa4a2e2..d3f23b640d34 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1348,6 +1348,9 @@ static void complete_signaling(struct drm_device *dev,
if (event && (event->base.fence || event->base.file_priv)) {
drm_event_cancel_free(dev, &event->base);
crtc_state->event = NULL;
+ } else if (event) {
+ kfree(event);
+ crtc_state->event = NULL;
}
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [syzbot] [dri?] memory leak in drm_mode_atomic_ioctl
2025-12-04 15:57 ` shaurya
@ 2025-12-04 16:47 ` syzbot
0 siblings, 0 replies; 3+ messages in thread
From: syzbot @ 2025-12-04 16:47 UTC (permalink / raw)
To: linux-kernel, ssranevjti, syzkaller-bugs
Hello,
syzbot has tested the proposed patch and the reproducer did not trigger any issue:
Reported-by: syzbot+3fc9eecaf97147282c87@syzkaller.appspotmail.com
Tested-by: syzbot+3fc9eecaf97147282c87@syzkaller.appspotmail.com
Tested on:
commit: 559e608c Merge tag 'ntfs3_for_6.19' of https://github...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1273eab4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=3bdbe6509b080086
dashboard link: https://syzkaller.appspot.com/bug?extid=3fc9eecaf97147282c87
compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=159bdcc2580000
Note: testing is done by a robot and is best-effort only.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-04 16:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-04 14:25 [syzbot] [dri?] memory leak in drm_mode_atomic_ioctl syzbot
2025-12-04 15:57 ` shaurya
2025-12-04 16:47 ` syzbot
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.