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 AE73E35B135; Fri, 9 Jan 2026 12:41:36 +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=1767962496; cv=none; b=QHs8mb/Zzewk9CYiCCjRqh8qfN8XgVC5RRZAmCjdFlWK8JFhO7qscer2x9f1eg8qHNSgWuwhO+9f0VffCPg3unCykP6rmYU1tJEb+GVTviysBL7cKmC4vLC0CT0XqBACCP+5soOEhIaJiPKLGOP2G9BwtFoFbnf6e0VjO2ZwCBA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767962496; c=relaxed/simple; bh=HjFKqIRgjFYJmsjeclMgZ3GjTnBm+Ga/buhARf5npZY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A0+A2xsC4D1AZOdcA5NYllTZ7V8N0+x8kZUlY6kXvFBAd083D7gJ5Xo6na1x3BCD4KMKx+TQC2nHPCdvWZ/kvqoQ7/WVixsDTPBkC7fyF+TJhqRj2F8neR6tjFlmSViwvthaSXjmUS8toewFfyXO//cCaLIT+sGgiWzwY6N4HCE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OzMeW9gy; 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="OzMeW9gy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECD4AC4CEF1; Fri, 9 Jan 2026 12:41:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767962496; bh=HjFKqIRgjFYJmsjeclMgZ3GjTnBm+Ga/buhARf5npZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OzMeW9gypHWqhYVuEuxKHhptplCuXrRj2E1U069Oeh9HtvfqAwQcvUKZumin4SoJJ 2Vil7Smf+8rGptPjLF3F4F3dED+hfSkjqm4zJWZana/G9bmSghG8jfdl7HIa1rhlU6 zxBu7+8QSvlXASsWObOv/lKYbJQWJjeIFTRdwFPE= 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 6.1 352/634] media: vidtv: initialize local pointers upon transfer of memory ownership Date: Fri, 9 Jan 2026 12:40:30 +0100 Message-ID: <20260109112130.770504499@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112117.407257400@linuxfoundation.org> References: <20260109112117.407257400@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 6.1-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);