From: Jeongjun Park <aha310510@gmail.com>
To: dwlsalmeida@gmail.com, mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
syzbot+1d9c0edea5907af239e0@syzkaller.appspotmail.com,
Jeongjun Park <aha310510@gmail.com>
Subject: [PATCH] media: vidtv: fix to initialize local pointers upon transfer of memory ownership
Date: Fri, 22 Aug 2025 15:58:49 +0900 [thread overview]
Message-ID: <20250822065849.1145572-1-aha310510@gmail.com> (raw)
vidtv_channel_si_init() transfers ownership of each object to the correct
table through functions such as vidtv_psi_*_assign().
However, since it does not set the local pointer to NULL afterwards, if it
fails for various reasons and jumps to a place such as free_*it, memory
that was freed in vidtv_psi_*_table_destroy() will be accessed and freed
again, resulting in use-after-free and double-free vuln.
Therefore, local pointers that have completed ownership transfer must be
initialized to NULL to prevent re-access to already freed memory.
Reported-by: syzbot+1d9c0edea5907af239e0@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1d9c0edea5907af239e0
Fixes: 3be8037960bc ("media: vidtv: add error checks")
Signed-off-by: Jeongjun Park <aha310510@gmail.com>
---
drivers/media/test-drivers/vidtv/vidtv_channel.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/test-drivers/vidtv/vidtv_channel.c b/drivers/media/test-drivers/vidtv/vidtv_channel.c
index f3023e91b3eb..3541155c6fc6 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_channel.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_channel.c
@@ -461,12 +461,15 @@ int vidtv_channel_si_init(struct vidtv_mux *m)
/* assemble all programs and assign to PAT */
vidtv_psi_pat_program_assign(m->si.pat, programs);
+ programs = NULL;
/* assemble all services and assign to SDT */
vidtv_psi_sdt_service_assign(m->si.sdt, services);
+ services = NULL;
/* assemble all events and assign to EIT */
vidtv_psi_eit_event_assign(m->si.eit, events);
+ events = NULL;
m->si.pmt_secs = vidtv_psi_pmt_create_sec_for_each_pat_entry(m->si.pat,
m->pcr_pid);
--
next reply other threads:[~2025-08-22 6:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 6:58 Jeongjun Park [this message]
2025-08-22 13:40 ` Daniel Almeida
2025-08-22 15:19 ` Jeongjun Park
2025-08-22 15:35 ` Daniel Almeida
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=20250822065849.1145572-1-aha310510@gmail.com \
--to=aha310510@gmail.com \
--cc=dwlsalmeida@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=syzbot+1d9c0edea5907af239e0@syzkaller.appspotmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®