[syzbot] [media?] memory leak in dvb_dmxdev_add_pid

6 views
Skip to first unread message

syzbot

unread,
Apr 25, 2026, 8:22:40 PM (18 hours ago) Apr 25
to linux-...@vger.kernel.org, linux...@vger.kernel.org, mch...@kernel.org, syzkall...@googlegroups.com
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+ba83b7...@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 syzk...@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

Edward Adam Davis

unread,
1:03 AM (13 hours ago) 1:03 AM
to syzbot+ba83b7...@syzkaller.appspotmail.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
#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,

syzbot

unread,
1:32 AM (13 hours ago) 1:32 AM
to ead...@qq.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+ba83b7...@syzkaller.appspotmail.com
Tested-by: syzbot+ba83b7...@syzkaller.appspotmail.com

Tested on:

commit: 897d5401 Merge tag 'fbdev-for-7.1-rc1-2' of git://git...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13f73236580000
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
patch: https://syzkaller.appspot.com/x/patch.diff?x=109809ba580000

Note: testing is done by a robot and is best-effort only.

Edward Adam Davis

unread,
1:33 AM (13 hours ago) 1:33 AM
to syzbot+ba83b7...@syzkaller.appspotmail.com, linux-...@vger.kernel.org, linux...@vger.kernel.org, mch...@kernel.org, syzkall...@googlegroups.com
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+ba83b7...@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ba83b7db8e644b8b7c19
Tested-by: syzbot+ba83b7...@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <ead...@qq.com>
---
drivers/media/dvb-core/dmxdev.c | 1 +
1 file changed, 1 insertion(+)
--
2.43.0

Reply all
Reply to author
Forward
0 new messages