From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 052663B71DC; Sat, 17 Oct 2026 16:47:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792255621; cv=none; b=evKMvWLEdUhTJ+cCv/CTW7QYy289M0R+p35/7lSG9cXeBaciCUYGwbCIypH6ZIG6B1GQCir/EMPlKpst/rBqNaNrBjBPrZ0VW6/LXwW6r6lshOMrfUIlZ12m99EXfhlTknC/hO4syH7UuuiXRrRowcAuXjcfKWQ9k+VO39xOLAM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792255621; c=relaxed/simple; bh=rTN4iVpUO322LXZFGCHYRbMxHmHjx/LlanIiwWXolzM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QeVAxZm9RDEF1Sd4oWfupKXu2vIQGCHw2IbeyZO6//0mzPZz5W430ML5iXHJhExQwFhyhadcsdB+/CH9OLGRZ+xR/oBiXLuVaEC7Ksj08/WAhC9INR1YnWCRIaOos/Oi9O9DZVaSw7c5qAceJRjokwA/sSO82I3rxMkZ8t2Kcww= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BtUdgxIv; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BtUdgxIv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6144A1F000C5; Sat, 17 Oct 2026 16:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792255619; bh=n721k2Hvp0luHkhT6DcjczdtFll2fPm+TwU7pZeprSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BtUdgxIvO01jfnlL5sR/utPYqgSb4imB/lOEym17sKHRC9DS6InfJwiDsasQfyfeW K2KHAI+ncm+io5LujBSTKROqXYXXwnsm3weCp0YHE4nooIfKmt4vnOPoerZSA+ogKd zed/qVwnKO5/JoLjnuVVNbUBOdaZWl7UxSC0pAOA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Krzysztof Kozlowski , Franz Schnyder , Marco Felsch , Ming Qian , Frank Li , stable@kernel.org, Nicolas Dufresne , Hans Verkuil , Sasha Levin Subject: [PATCH 6.12 834/869] media: verisilicon: Fix kernel panic due to __initconst misuse Date: Sat, 17 Oct 2026 18:01:15 +0200 Message-ID: <20261017160058.259738223@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160036.979869304@linuxfoundation.org> References: <20261017160036.979869304@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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ming Qian [ Upstream commit e8d97c270cb46a2a88739019d0f8547adc7d97da ] Fix a kernel panic when probing the driver as a module: Unable to handle kernel paging request at virtual address ffffd9c18eb05000 of_find_matching_node_and_match+0x5c/0x1a0 hantro_probe+0x2f4/0x7d0 [hantro_vpu] The imx8mq_vpu_shared_resources array is referenced by variant structures through their shared_devices field. When built as a module, __initconst causes this data to be freed after module init, but it's later accessed during probe, causing a page fault. The imx8mq_vpu_shared_resources is referenced from non-init code, so keeping __initconst or __initconst_or_module here is wrong. Drop the __initconst annotation and let it live in the normal .rodata section. A bug of __initconst called from regular non-init probe code leading to bugs during probe deferrals or during unbind-bind cycles. Reported-by: Krzysztof Kozlowski Closes: https://lore.kernel.org/all/68ef934f-baa0-4bf6-93d8-834bbc441e66@kernel.org/ Reported-by: Franz Schnyder Closes: https://lore.kernel.org/all/n3qmcb62tepxltoskpf7ws6yiirc2so62ia23b42rj3wlmpl67@rvkbuirx7kkp/ Fixes: e0203ddf9af7 ("media: verisilicon: Avoid G2 bus error while decoding H.264 and HEVC") Suggested-by: Krzysztof Kozlowski Suggested-by: Marco Felsch Reviewed-by: Marco Felsch Signed-off-by: Ming Qian Reviewed-by: Frank Li Reviewed-by: Krzysztof Kozlowski Cc: stable@kernel.org Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/platform/verisilicon/imx8m_vpu_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c index cdaac2f18fb54..de27c142b7fe4 100644 --- a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c +++ b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c @@ -361,7 +361,7 @@ const struct hantro_variant imx8mq_vpu_variant = { .num_regs = ARRAY_SIZE(imx8mq_reg_names) }; -static const struct of_device_id imx8mq_vpu_shared_resources[] __initconst = { +static const struct of_device_id imx8mq_vpu_shared_resources[] = { { .compatible = "nxp,imx8mq-vpu-g1", }, { .compatible = "nxp,imx8mq-vpu-g2", }, { /* sentinel */ } -- 2.53.0