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 BB1834F68AD; Tue, 13 Oct 2026 12:29:39 +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=1791894580; cv=none; b=OIg//raDr08k//w0zChQmhORdaZE2qn2rXJQJTNudEQQPZzBUf5pNVs+MpsZ5OaxkS+jq8ffM/nWfCWUHpQTf2wDfr/hreyJP96osOoe0vCNYxoB4D3bXh67CXVxVws4mUt08PhBY49BygYZPmbMAadCiJ0p4vlpIYpQu+NoGjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791894580; c=relaxed/simple; bh=2L76SwUhNJ7JZbZtFmj8ix9aqX8S76ILeB+N0r4Kv9A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SrziFS7k1t0YmNseG2g+617vHLNhkhEg2mclvXKh+H/sZOxBVuqglFuLkvraGxykNjn6cD+BZuUefD7dkoG81ftpSs59RnzOop4rIxisKFq9d/QmssZt6Z5feWEmCLWm7dy7h5lB2+8MCMWfDkeQx5WsVHN7NSvh0eW9ttuRR+Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NxmVQ43k; 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="NxmVQ43k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D26E21F000FF; Tue, 13 Oct 2026 12:29:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791894579; bh=GQ56N8ULAf9ua4ggqEIeoFirwnFNJyQ4tewQzzo2Ci4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NxmVQ43kwkW8HDBKvB7Sf/in1GpvYOrefT01kRn0wNGZcYakZ/NS9y4FGXxPodY+Z CtBEwgG69EILkOc2M/NOu25iX/C6m2N5ofGGXaiIivl1LOxXSMiHb8GqJ9a0S3qKkd 7k+lWBU30t4FlPeG7aqshqFs3Af97R184j8GbvCs= 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 Subject: [PATCH 6.18 607/621] media: verisilicon: Fix kernel panic due to __initconst misuse Date: Tue, 13 Oct 2026 13:40:02 +0200 Message-ID: <20261013112935.203578009@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112920.855194808@linuxfoundation.org> References: <20261013112920.855194808@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ming Qian commit e8d97c270cb46a2a88739019d0f8547adc7d97da upstream. 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: Greg Kroah-Hartman --- drivers/media/platform/verisilicon/imx8m_vpu_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c +++ b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c @@ -343,7 +343,7 @@ const struct hantro_variant imx8mq_vpu_v .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 */ }