mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "NG, ADRIAN HO YIN" <adrian.ho.yin.ng@altera.com>
To: Dinh Nguyen <dinguyen@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] firmware: stratix10-svc: fix kaddr dangling pointers and populate kaddr1
Date: Thu, 10 Sep 2026 01:09:49 +0800	[thread overview]
Message-ID: <eb7eabac-1557-4956-af05-f7220f14a1ae@altera.com> (raw)
In-Reply-To: <ee89861d-b0f6-46bf-a7cc-310da1f1acda@kernel.org>


On 9/3/2026 12:31 AM, Dinh Nguyen wrote:
>
>
> On 5/26/26 15:35, Adrian Ng Ho Yin wrote:
>> kaddr1/2/3 in the stratix10 service layer are set to addresses of local
>> arm_smccc_res fields that go out of scope when the setting function 
>> returns,
>> leaving dangling pointers in the callback data.
>>
>> Patch 1 fixes this by adding a1/a2/a3 scratch fields to struct
>> stratix10_svc_cb_data, which lives for the SVC thread lifetime, and
>> pointing kaddrN to those fields instead of the stack.
>>
>> Patch 2 uses the same mechanism to populate the previously unset 
>> kaddr1 in
>> svc_thread_cmd_config_status(), exposing firmware status details to 
>> callers.
>>
>> Adrian Ng Ho Yin (2):
>>    firmware: stratix10-svc: fix dangling kaddr pointers in callback data
>>    firmware: stratix10-svc: populate kaddr1 from config status response
>>
>>   drivers/firmware/stratix10-svc.c              | 45 ++++++++++++-------
>>   .../firmware/intel/stratix10-svc-client.h     | 17 +++++++
>>   2 files changed, 47 insertions(+), 15 deletions(-)
>>
>
> Do these patches need to get backport into a stable release? If so, 
> please add the appropriated Fixes tag.
>
> Thanks,
> Dinh
Hi Dinh,

The callbacks run while arm_smccc_res is still on the stack, and the
current clients copy kaddr* during the callback. They do not keep those
pointers afterwards, so this is not a stable bug.

I am dropping patch 1 for that reason. v2 will be only the kaddr1
populate on the config-status completed path, using &res.a1 like the
existing error path. That is a small feature, not a regression fix.

Thanks,
Adrian

      reply	other threads:[~2026-09-09 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26  7:35 Adrian Ng Ho Yin
2026-05-26  7:35 ` [PATCH 1/2] firmware: stratix10-svc: fix dangling kaddr pointers in callback data Adrian Ng Ho Yin
2026-05-26  7:35 ` [PATCH 2/2] firmware: stratix10-svc: populate kaddr1 from config status response Adrian Ng Ho Yin
2026-09-02 16:31 ` [PATCH 0/2] firmware: stratix10-svc: fix kaddr dangling pointers and populate kaddr1 Dinh Nguyen
2026-09-09 17:09   ` NG, ADRIAN HO YIN [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=eb7eabac-1557-4956-af05-f7220f14a1ae@altera.com \
    --to=adrian.ho.yin.ng@altera.com \
    --cc=dinguyen@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®