From: Soham Kute <officialsohamkute@gmail.com>
To: dwlsalmeida@gmail.com, mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Soham Kute <officialsohamkute@gmail.com>,
syzbot+814c351d094f41a1b86@syzkaller.appspotmail.com
Subject: [PATCH] [PATCH v2] media: vidtv: fix general protection fault in vidtv_psi_ts_psi_write_into
Date: Sun, 8 Feb 2026 02:09:47 +0530 [thread overview]
Message-ID: <20260207203947.4354-1-officialsohamkute@gmail.com> (raw)
Add defensive validation for psi_write_args pointers to avoid
null pointer dereference reported by syzbot.
Reported-by: syzbot+814c351d094f41a1b86@syzkaller.appspotmail.com
Signed-off-by: Soham Kute <officialsohamkute@gmail.com>
---
drivers/media/test-drivers/vidtv/vidtv_psi.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/media/test-drivers/vidtv/vidtv_psi.c b/drivers/media/test-drivers/vidtv/vidtv_psi.c
index 2a51c898c..bac0ea03b 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_psi.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_psi.c
@@ -156,7 +156,13 @@ static void vidtv_psi_set_sec_len(struct vidtv_psi_table_header *h, u16 new_len)
* add stuffing (i.e. padding bytes) after the CRC
*/
static u32 vidtv_psi_ts_psi_write_into(struct psi_write_args *args)
-{
+{
+ if (!args || !args->dest_buf || !args->from ||
+ !args->continuity_counter) {
+ pr_warn_once("%s: invalid write arguments\n", __func__);
+ return 0;
+ }
+
struct vidtv_mpeg_ts ts_header = {
.sync_byte = TS_SYNC_BYTE,
.bitfield = cpu_to_be16((args->new_psi_section << 14) | args->pid),
--
2.34.1
next reply other threads:[~2026-02-07 20:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-07 20:39 Soham Kute [this message]
2026-02-07 20:41 ` [PATCH] [PATCH v2] media: vidtv: fix general protection fault in vidtv_psi_ts_psi_write_into syzbot
2026-03-16 13:33 ` Hans Verkuil
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=20260207203947.4354-1-officialsohamkute@gmail.com \
--to=officialsohamkute@gmail.com \
--cc=dwlsalmeida@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=syzbot+814c351d094f41a1b86@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