* [syzbot] [media?] memory leak in dvb_dmxdev_add_pid
@ 2026-04-26 0:22 syzbot
2026-04-26 5:03 ` Edward Adam Davis
2026-04-26 5:33 ` [PATCH] media: dvb-core: release pid memory when set filter to sec Edward Adam Davis
0 siblings, 2 replies; 4+ messages in thread
From: syzbot @ 2026-04-26 0:22 UTC (permalink / raw)
To: linux-kernel, linux-media, mchehab, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 27d128c1cff6 Merge tag 'trace-ring-buffer-v7.1-3' of git:/..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=126522ce580000
kernel config: https://syzkaller.appspot.com/x/.config?x=9645c21cfd1d3e8f
dashboard link: https://syzkaller.appspot.com/bug?extid=ba83b7db8e644b8b7c19
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=108352d2580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=166522ce580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7aa00f1165c2/disk-27d128c1.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bba58839d563/vmlinux-27d128c1.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6b9d69ada8d6/bzImage-27d128c1.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ba83b7db8e644b8b7c19@syzkaller.appspotmail.com
BUG: memory leak
unreferenced object 0xffff88810b771800 (size 32):
comm "syz.0.17", pid 5923, jiffies 4294942824
hex dump (first 32 bytes):
02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
08 00 56 05 00 c9 ff ff 08 00 56 05 00 c9 ff ff ..V.......V.....
backtrace (crc 1a56a8d7):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4574 [inline]
slab_alloc_node mm/slub.c:4898 [inline]
__kmalloc_cache_noprof+0x371/0x480 mm/slub.c:5410
kmalloc_noprof include/linux/slab.h:950 [inline]
kzalloc_noprof include/linux/slab.h:1188 [inline]
dvb_dmxdev_add_pid+0x9c/0x160 drivers/media/dvb-core/dmxdev.c:897
dvb_dmxdev_pes_filter_set drivers/media/dvb-core/dmxdev.c:972 [inline]
dvb_demux_do_ioctl+0x3c6/0x7d0 drivers/media/dvb-core/dmxdev.c:1092
dvb_usercopy+0x116/0x2d0 drivers/media/dvb-core/dvbdev.c:996
dvb_demux_ioctl+0x29/0x40 drivers/media/dvb-core/dmxdev.c:1201
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+0xee/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
BUG: memory leak
unreferenced object 0xffff8881297f65e0 (size 32):
comm "syz.0.18", pid 5934, jiffies 4294942829
hex dump (first 32 bytes):
02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
08 00 56 05 00 c9 ff ff 08 00 56 05 00 c9 ff ff ..V.......V.....
backtrace (crc 1a56a8d7):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4574 [inline]
slab_alloc_node mm/slub.c:4898 [inline]
__kmalloc_cache_noprof+0x371/0x480 mm/slub.c:5410
kmalloc_noprof include/linux/slab.h:950 [inline]
kzalloc_noprof include/linux/slab.h:1188 [inline]
dvb_dmxdev_add_pid+0x9c/0x160 drivers/media/dvb-core/dmxdev.c:897
dvb_dmxdev_pes_filter_set drivers/media/dvb-core/dmxdev.c:972 [inline]
dvb_demux_do_ioctl+0x3c6/0x7d0 drivers/media/dvb-core/dmxdev.c:1092
dvb_usercopy+0x116/0x2d0 drivers/media/dvb-core/dvbdev.c:996
dvb_demux_ioctl+0x29/0x40 drivers/media/dvb-core/dmxdev.c:1201
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+0xee/0xf80 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] 4+ messages in thread* Re: [syzbot] [media?] memory leak in dvb_dmxdev_add_pid
2026-04-26 0:22 [syzbot] [media?] memory leak in dvb_dmxdev_add_pid syzbot
@ 2026-04-26 5:03 ` Edward Adam Davis
2026-04-26 5:32 ` syzbot
2026-04-26 5:33 ` [PATCH] media: dvb-core: release pid memory when set filter to sec Edward Adam Davis
1 sibling, 1 reply; 4+ messages in thread
From: Edward Adam Davis @ 2026-04-26 5:03 UTC (permalink / raw)
To: syzbot+ba83b7db8e644b8b7c19; +Cc: linux-kernel, syzkaller-bugs
#syz test
diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index 3c8bc75e4d6c..62733859f639 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -937,6 +937,7 @@ static int dvb_dmxdev_filter_set(struct dmxdev *dmxdev,
__func__, params->pid, params->flags, params->timeout);
dvb_dmxdev_filter_stop(dmxdevfilter);
+ dvb_dmxdev_filter_reset(dmxdevfilter);
dmxdevfilter->type = DMXDEV_TYPE_SEC;
memcpy(&dmxdevfilter->params.sec,
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] media: dvb-core: release pid memory when set filter to sec
2026-04-26 0:22 [syzbot] [media?] memory leak in dvb_dmxdev_add_pid syzbot
2026-04-26 5:03 ` Edward Adam Davis
@ 2026-04-26 5:33 ` Edward Adam Davis
1 sibling, 0 replies; 4+ messages in thread
From: Edward Adam Davis @ 2026-04-26 5:33 UTC (permalink / raw)
To: syzbot+ba83b7db8e644b8b7c19
Cc: linux-kernel, linux-media, mchehab, syzkaller-bugs
The user first executes set pes filter to create a PID, and subsequently
executes set filter to sec. Within dvb_dmxdev_filter_set(), however, only
the PES filter is stopped, and the memory associated with the PID is not
reclaimed. Consequently, when dvb_demux_release() is executed upon file
closure at which point the filter type has already been updated to
DMXDEV_TYPE_SEC, the memory consumed by the PID originally generated for
the PES filter is never reclaimed. This triggers the memory leak reported
in [1].
Added a call to dvb_dmxdev_filter_reset() during the execution of
dvb_dmxdev_filter_set() to free the PID memory.
[1]
BUG: memory leak
unreferenced object 0xffff88810b771800 (size 32):
backtrace (crc 1a56a8d7):
dvb_dmxdev_add_pid+0x9c/0x160 drivers/media/dvb-core/dmxdev.c:897
dvb_dmxdev_pes_filter_set drivers/media/dvb-core/dmxdev.c:972 [inline]
dvb_demux_do_ioctl+0x3c6/0x7d0 drivers/media/dvb-core/dmxdev.c:1092
dvb_usercopy+0x116/0x2d0 drivers/media/dvb-core/dvbdev.c:996
dvb_demux_ioctl+0x29/0x40 drivers/media/dvb-core/dmxdev.c:1201
Reported-by: syzbot+ba83b7db8e644b8b7c19@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ba83b7db8e644b8b7c19
Tested-by: syzbot+ba83b7db8e644b8b7c19@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
drivers/media/dvb-core/dmxdev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index 3c8bc75e4d6c..62733859f639 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -937,6 +937,7 @@ static int dvb_dmxdev_filter_set(struct dmxdev *dmxdev,
__func__, params->pid, params->flags, params->timeout);
dvb_dmxdev_filter_stop(dmxdevfilter);
+ dvb_dmxdev_filter_reset(dmxdevfilter);
dmxdevfilter->type = DMXDEV_TYPE_SEC;
memcpy(&dmxdevfilter->params.sec,
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-04-26 5:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-26 0:22 [syzbot] [media?] memory leak in dvb_dmxdev_add_pid syzbot
2026-04-26 5:03 ` Edward Adam Davis
2026-04-26 5:32 ` syzbot
2026-04-26 5:33 ` [PATCH] media: dvb-core: release pid memory when set filter to sec Edward Adam Davis
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.