Devicetree
 help / color / mirror / Atom feed
From: Faiyaz Mohammed <faiyaz.mohammed@oss.qualcomm.com>
To: sashiko-reviews@lists.linux.dev
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 4/4] arm64: dts: qcom: shikra: add LCP/SRP ECC interrupt to LLCC node
Date: Wed, 21 Oct 2026 17:33:56 +0530	[thread overview]
Message-ID: <d4d8a3f1-b1df-4486-b79d-e8d406c91e69@oss.qualcomm.com> (raw)
In-Reply-To: <sashiko-outbox-171515@kernel.org>



On 14-10-2026 21:38, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] edac: qcom: UAF in IRQ handlers due to asymmetrical devm vs manual teardown
This is a DTS-only patch; the driver concern is addressed in the
response to Patch 3.

The identical race exists for the pre-existing ecc_irq INT path which
also uses devm_request_irq() with edev_ctl as dev_id. Fixing only
lcp_irq would create an asymmetry. The correct fix is to convert both
IRQs to non-devm with explicit free_irq() before
edac_device_free_ctl_info() in qcom_llcc_edac_remove() — that is a
pre-existing driver-wide cleanup not introduced by this series.

> --
> 
> commit fab541f0482e82717fee45392a6aa89253bbeef9
> Author: Faiyaz Mohammed <faiyaz.mohammed@oss.qualcomm.com>
> 
> arm64: dts: qcom: shikra: add LCP/SRP ECC interrupt to LLCC node
> 
> Add a second interrupt for LCP/SRP DDR DRAM ECC reporting and
> interrupt-names ("llcc-ecc", "llcc-lcp-ecc") to the Shikra LLCC node,
> as required by the updated DT binding.
> 
>> diff --git a/arch/arm64/boot/dts/qcom/shikra.dtsi b/arch/arm64/boot/dts/qcom/shikra.dtsi
>> index 2623e139196f6..ff572c003b396 100644
>> --- a/arch/arm64/boot/dts/qcom/shikra.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/shikra.dtsi
>> @@ -1108,7 +1108,9 @@ llcc: system-cache-controller@e00000 {
>>  			reg-names = "llcc0_base",
>>  				    "llcc1_base",
>>  				    "llcc_broadcast_base";
>> -			interrupts = <GIC_SPI 539 IRQ_TYPE_LEVEL_HIGH 0>;
>> +			interrupts = <GIC_SPI 539 IRQ_TYPE_LEVEL_HIGH 0>,
>> +				     <GIC_SPI 538 IRQ_TYPE_LEVEL_HIGH 0>;
>> +			interrupt-names = "llcc-ecc", "llcc-lcp-ecc";
> 
> [Severity: High]
> Does adding this new interrupt expose a use-after-free race condition in the
> EDAC driver?
> 
> In drivers/edac/qcom_edac.c, devm-managed IRQs remain active until the devres
> phase, but edac_device_free_ctl_info() manually frees the payload object:
> 
> drivers/edac/qcom_edac.c:qcom_llcc_edac_remove() {
> 	...
> 	edac_device_free_ctl_info(edev_ctl);
> 	...
> }
> 
> If the newly enabled lcp_irq or the ecc_irq fires during module removal
> (after qcom_llcc_edac_remove() frees edev_ctl but before devres deregisters
> the IRQs), can the interrupt handler dereference the freed edev_ctl?
> 
> drivers/edac/qcom_edac.c:llcc_lcp_ecc_irq_handler() {
> 	...
> 	struct llcc_drv_data *drv = edac_dev_ctl->dev->platform_data;
> 	...
> }
> 
> This could lead to invalid memory accesses, unpredictable behavior,
> or a kernel panic.
> 
> The same race seems to exist on the probe error path if
> edac_device_add_device() fails, leaving the IRQ active until the function
> returns:
> 
> drivers/edac/qcom_edac.c:qcom_llcc_edac_probe() {
> 	...
> 	rc = edac_device_add_device(edev_ctl);
> 	if (rc) {
> 		edac_device_free_ctl_info(edev_ctl);
> 		return rc;
> 	}
> 	...
> }
> 
>>  		};
>>  
>>  		gcc: clock-controller@1400000 {
> 

Thanks & regards,
Mohammed Faiyaz

      reply	other threads:[~2026-10-21 12:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 15:56 [PATCH 0/4] edac: qcom: add DDR DRAM ECC reporting for Shikra (QCM2390) Faiyaz Mohammed
2026-10-14 15:56 ` [PATCH 1/4] dt-bindings: cache: qcom,llcc: allow optional second interrupt for LCP/SRP ECC Faiyaz Mohammed
2026-10-14 16:05   ` sashiko-bot
2026-10-21 11:43     ` Faiyaz Mohammed
2026-10-17 16:34   ` Krzysztof Kozlowski
2026-10-21 11:47     ` Faiyaz Mohammed
2026-10-14 15:56 ` [PATCH 2/4] soc: qcom: llcc: add LCP/SRP DDR DRAM ECC register offsets Faiyaz Mohammed
2026-10-16 17:20   ` Jonathan Cameron
2026-10-21 11:49     ` Faiyaz Mohammed
2026-10-17 16:34   ` Krzysztof Kozlowski
2026-10-21 11:54     ` Faiyaz Mohammed
2026-10-14 15:56 ` [PATCH 3/4] edac: qcom: add LCP/SRP DDR DRAM ECC support for Shikra Faiyaz Mohammed
2026-10-14 16:09   ` sashiko-bot
2026-10-21 11:58     ` Faiyaz Mohammed
2026-10-16 17:26   ` Jonathan Cameron
2026-10-21 12:01     ` Faiyaz Mohammed
2026-10-14 15:56 ` [PATCH 4/4] arm64: dts: qcom: shikra: add LCP/SRP ECC interrupt to LLCC node Faiyaz Mohammed
2026-10-14 16:08   ` sashiko-bot
2026-10-21 12:03     ` Faiyaz Mohammed [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4d8a3f1-b1df-4486-b79d-e8d406c91e69@oss.qualcomm.com \
    --to=faiyaz.mohammed@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox