From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6091F32E696; Mon, 20 Apr 2026 15:55:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776700545; cv=none; b=gg4dMWmV/S3QdqBir6PqvfoijoGOJQaJCi0BTnk49h7+etNafztgvh+RcIDNwDlRPifV71a9Y0BN2fES7XrvwxOH5sUZQ+MXPM/04wj8iF9DWIqdGxwnzhw4TPOiljZECEjG+eSwKfj7zT70ZnmYrvGwNqLYgrwJbooxoHQdxKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776700545; c=relaxed/simple; bh=SS9UAZ5MZzE26YC4HJItbtfTQoOzoDkd/KgW9XZA7yM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Or2cZfiHx8tJtLTvSLL7vf4s7M2CoQs+yGkCpcw9pUvhK6yCfXTEv5MIZ1Avca2lImjiOa+aLOA3JDpgH12PjWdgNuDeHufRV8aYwRIN5pO8vmpNj/fXhbNn+sXxiwT5watcB/+OG4ASp9H6Vh4NFxmuEAeVUn1TKtlO7XUOOIE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YuGY1QRn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YuGY1QRn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA251C19425; Mon, 20 Apr 2026 15:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776700545; bh=SS9UAZ5MZzE26YC4HJItbtfTQoOzoDkd/KgW9XZA7yM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YuGY1QRn60fFf+nZLUiNri25fwHaPxkdTUNhnDCtqe3dXBynu4h5bZbQ8WPNe/f0o P6Oy2KIvdbCeYsGoGVXVhwGW86rRvF4FlGQ06GfZGWas64bVyx00xztphzDMroL3qB HfGiYgiCyzf6L39NusOCEXPHeU3LqJEXUqLdaJLE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+1f5bcc7c919ec578777a@syzkaller.appspotmail.com, Ruslan Valiyev , Hans Verkuil Subject: [PATCH 6.19 181/220] media: vidtv: fix NULL pointer dereference in vidtv_channel_pmt_match_sections Date: Mon, 20 Apr 2026 17:42:02 +0200 Message-ID: <20260420153940.544846241@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260420153934.013228280@linuxfoundation.org> References: <20260420153934.013228280@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ruslan Valiyev commit f8e1fc918a9fe67103bcda01d20d745f264d00a7 upstream. syzbot reported a general protection fault in vidtv_psi_desc_assign [1]. vidtv_psi_pmt_stream_init() can return NULL on memory allocation failure, but vidtv_channel_pmt_match_sections() does not check for this. When tail is NULL, the subsequent call to vidtv_psi_desc_assign(&tail->descriptor, desc) dereferences a NULL pointer offset, causing a general protection fault. Add a NULL check after vidtv_psi_pmt_stream_init(). On failure, clean up the already-allocated stream chain and return. [1] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] RIP: 0010:vidtv_psi_desc_assign+0x24/0x90 drivers/media/test-drivers/vidtv/vidtv_psi.c:629 Call Trace: vidtv_channel_pmt_match_sections drivers/media/test-drivers/vidtv/vidtv_channel.c:349 [inline] vidtv_channel_si_init+0x1445/0x1a50 drivers/media/test-drivers/vidtv/vidtv_channel.c:479 vidtv_mux_init+0x526/0xbe0 drivers/media/test-drivers/vidtv/vidtv_mux.c:519 vidtv_start_streaming drivers/media/test-drivers/vidtv/vidtv_bridge.c:194 [inline] vidtv_start_feed+0x33e/0x4d0 drivers/media/test-drivers/vidtv/vidtv_bridge.c:239 Fixes: f90cf6079bf67 ("media: vidtv: add a bridge driver") Cc: stable@vger.kernel.org Reported-by: syzbot+1f5bcc7c919ec578777a@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=1f5bcc7c919ec578777a Signed-off-by: Ruslan Valiyev Signed-off-by: Hans Verkuil Signed-off-by: Greg Kroah-Hartman --- drivers/media/test-drivers/vidtv/vidtv_channel.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/media/test-drivers/vidtv/vidtv_channel.c +++ b/drivers/media/test-drivers/vidtv/vidtv_channel.c @@ -341,6 +341,10 @@ vidtv_channel_pmt_match_sections(struct tail = vidtv_psi_pmt_stream_init(tail, s->type, e_pid); + if (!tail) { + vidtv_psi_pmt_stream_destroy(head); + return; + } if (!head) head = tail;