mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Shiyan <eagle.alexander923@gmail.com>
Cc: Barebox List <barebox@lists.infradead.org>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: Re: arm psci_probe() bug
Date: Thu, 3 Aug 2023 10:30:16 +0200	[thread overview]
Message-ID: <20230803083016.GB7788@pengutronix.de> (raw)
In-Reply-To: <CAP1tNvRt9ohDy3n3AJ1Fzvvqgbv_0V0iVM1urQWOzN2pT-xgpA@mail.gmail.com>

Hi Alexander,

On Thu, Aug 03, 2023 at 11:04:36AM +0300, Alexander Shiyan wrote:
> Hello.
> 
> I found a bug in psci processing.
> Currently the kernel writes the following on boot:
> psci: probing for conduit method from DT.
> psci: invalid "method" property:
> ...
> 
> In the psci_probe() function we do the following:
> ret = of_property_read_string(dev->of_node, "method", &method);
> and use this (method) variable as an argument for of_psci_fixup().
> I suspect we are free this variable at of_property_write_string ->
> of_set_property > of_delete_property.
> 
> Can you confirm my thought and correct it in the right direction?

Are you using the internal device tree for booting? If yes, then I think
this can happen. As I just saw when booting with the internal device
tree then of_get_fixed_tree() is called with the barebox live tree as
argument. We shouldn't do this and use a copy instead.

Nevertheless I think we shouldn't assume the string returned from
of_property_read_string() is valid for all eternity and make a copy
there as well.

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2023-08-03  8:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03  8:04 Alexander Shiyan
2023-08-03  8:30 ` Sascha Hauer [this message]
2023-08-03  8:54   ` Sascha Hauer

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=20230803083016.GB7788@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=eagle.alexander923@gmail.com \
    /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