From: Daniel Almeida <daniel.almeida@collabora.com>
To: Jeongjun Park <aha310510@gmail.com>
Cc: mchehab@kernel.org, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
syzbot+1d9c0edea5907af239e0@syzkaller.appspotmail.com
Subject: Re: [PATCH v2 RESEND] media: vidtv: initialize local pointers upon transfer of memory ownership
Date: Thu, 4 Sep 2025 16:09:56 -0300 [thread overview]
Message-ID: <67D8F9B1-3121-469A-8F50-952BD4C0C99F@collabora.com> (raw)
In-Reply-To: <20250904054000.3848107-1-aha310510@gmail.com>
Hi Jeongjun,
You’re resending this, but there were comments on v2.
If you’ve taken steps to address them, please send a v3 instead.
> On 4 Sep 2025, at 02:40, Jeongjun Park <aha310510@gmail.com> wrote:
>
> vidtv_channel_si_init() creates a temporary list (program, service, event)
> and ownership of the memory itself is transferred to the PAT/SDT/EIT
> tables through vidtv_psi_pat_program_assign(),
> vidtv_psi_sdt_service_assign(), vidtv_psi_eit_event_assign().
>
> The problem here is that the local pointer where the memory ownership
> transfer was completed is not initialized to NULL. This causes the
> vidtv_psi_pmt_create_sec_for_each_pat_entry() function to fail, and
> in the flow that jumps to free_eit, the memory that was freed by
> vidtv_psi_*_table_destroy() can be accessed again by
> vidtv_psi_*_event_destroy() due to the uninitialized local pointer, so it
> is freed once again.
>
> Therefore, to prevent use-after-free and double-free vuln, local pointers
Please do not use “vuln” instead of vulnerability.
> must be initialized to NULL when transferring memory ownership.
>
> Cc: <stable@vger.kernel.org>
> 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>
> ---
> v2: Improved patch description wording and CC stable mailing list
> - Link to v1: https://lore.kernel.org/all/20250822065849.1145572-1-aha310510@gmail.com/
> ---
> drivers/media/test-drivers/vidtv/vidtv_channel.c | 3 +++
> 1 file changed, 3 insertions(+)
— Daniel
prev parent reply other threads:[~2025-09-04 19:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 5:40 Jeongjun Park
2025-09-04 19:09 ` Daniel Almeida [this message]
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=67D8F9B1-3121-469A-8F50-952BD4C0C99F@collabora.com \
--to=daniel.almeida@collabora.com \
--cc=aha310510@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=stable@vger.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®