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 CFB6C3C1987; Thu, 15 Jan 2026 17:51:33 +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=1768499493; cv=none; b=twQ5WmLD4N9hciMJbgq1vIH0nsdxmJNh30AjzIJnMDm01gu5Wd3NVAXC1eHx3bsOqRQm+Hx6p9t5oSs/k7rsQHRZVz1FxXqHFETvWHHAfGNm6ssHlPXZQE7BJAVUZ3dCGw/+ku+3n/e5BL+aFZ7hU3shnz+3TnrD6SVL+Q2anFY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768499493; c=relaxed/simple; bh=zM/Upa3ZlpCfrMrfe49Lg858Hf6H+iazElK1epBNBts=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VES4ANvSXbqVSMqa616HAK0Bd/Dd7nn2w1nUJtUb357BDgDhGFfeVt+HGbh7TNnX/Yk1TLVnO6QlpzK6YD8t3u5yAh9epPk35OYdyLhMjG7XxRsOuD9WG3RosiQFoNqbpVAcr3/7ViE+3/dLUKmjH4yBGJzX72i0BZUjBx8E4Zg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oeCmvshi; 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="oeCmvshi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15FE2C116D0; Thu, 15 Jan 2026 17:51:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768499493; bh=zM/Upa3ZlpCfrMrfe49Lg858Hf6H+iazElK1epBNBts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oeCmvshizw+jYn2SKc5z3ObiC8R/UuoFXgN2vhAnKY5zEXDqmqoQpmeKhhrx9x5Cx j8nbM+IwCxUanxCOn6GhiB3FqJWYYXZOu6gRgXW8Y2iET1FjQZNTLExmmJbKHuRJ5U Bu+Cvz2SiqnCVwqIky8Me4Yh2P4pJjWYaDZrsBCc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+1d9c0edea5907af239e0@syzkaller.appspotmail.com, Jeongjun Park , Daniel Almeida , Hans Verkuil Subject: [PATCH 5.10 247/451] media: vidtv: initialize local pointers upon transfer of memory ownership Date: Thu, 15 Jan 2026 17:47:28 +0100 Message-ID: <20260115164239.828101742@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115164230.864985076@linuxfoundation.org> References: <20260115164230.864985076@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jeongjun Park commit 98aabfe2d79f74613abc2b0b1cef08f97eaf5322 upstream. 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 vulnerability, local pointers must be initialized to NULL when transferring memory ownership. Cc: 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 Reviewed-by: Daniel Almeida Signed-off-by: Hans Verkuil Signed-off-by: Greg Kroah-Hartman --- drivers/media/test-drivers/vidtv/vidtv_channel.c | 3 +++ 1 file changed, 3 insertions(+) --- 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_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);