From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385950; b=Sul9UxBa14wGOmE6t4fgHSBzdNmfjc0Fhrl83oV8m2/GljE+qkV9Ec0Qnla3SRu6psg2 p64HvcBxWgP0vKm7arwAxETHu7eyzLlSWAha8gZzFELDOtkOjEfFXnjl3BCRNkXdtfkM1 oLuaeMndfuFMDAwRrgfGAVl4z6rI1FG/XYpcvggnvirSWwXtAdpBiPfbCr+Mm5ZdGY7ZG l05OG5fU+TNpMu5mHrXAq3fptz9SQ61psyXBdFiQhJFqtGCqmv1AX2vJCthmEqYXwITjG XfxR8nTbxv6nAiNJZRbdADf6vwaoKLn3ygIOaGbExQJ/dIy46p8zAmUI46unmjWFNdw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385950; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=01YnSajmHR1UOSY/oYtOvwgws/9XxboE7y7QuF75or0=; b=4okK1hFVfTJGirk+Huw0EohVLCtbJ6wMal5VgUF7jTWjn7OZE3vPvFLxthRr/yzml8kb f/dCQ+4qVHyz+/2hRgBEzedDQii2hGhnZpqxXEXW0T/sGAGMSXiJ4lkM3yqmO0QOCKXQU Lgdj/uHrkCL3Pyz1ohaoqEuVvDvcQiQLl1eue2GiaXgj1Vj+pyWME7tpy8iLOzkMrwBtd e2QUzue1EiTAfNyC4mUMLUUar7XMVpKkmOqwh1v9Jpu5q5V8M3nzphlKHH3EtLGGAsYNa YzhvYr6C91NLtVq1LPV5EydOb032/E61fnCW9L/KpGHlBEcCB9WZLZPn/mi8tW9QRHw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jLiyB7FF; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D269606A32C; Fri, 4 Dec 2026 12:05:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jLiyB7FF Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2C7B1F000CE; Fri, 4 Dec 2026 12:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385950; bh=01YnSajmHR1UOSY/oYtOvwgws/9XxboE7y7QuF75or0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jLiyB7FFnTuBWOWv3pKJbE9CFmG9uILjkpzXAOlUojP+CJeHZJdiBigluNzPHZrhj f9prIOFCrjthExHBXtS7qhmBEVmVkPWZ1QgUETffL9mHeOXRFN76BtfhnIFa2R1hzT WeTOGM45Ifrp4kMPr/PNrIsegK3xEjcY0oNIdcSk= 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.6 0759/1167] media: verisilicon: Fix kernel panic due to __initconst misuse Date: Fri, 4 Dec 2026 19:03:06 +0900 Message-ID: <20261204100721.847353861@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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