lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250502163559.0a5643e5@booty>
Date: Fri, 2 May 2025 16:35:59 +0200
From: Luca Ceresoli <luca.ceresoli@...tlin.com>
To: Herve Codina <herve.codina@...tlin.com>
Cc: David Gibson <david@...son.dropbear.id.au>, Andrew Davis <afd@...com>,
 Ayush Singh <ayush@...gleboard.org>, Geert Uytterhoeven
 <geert@...ux-m68k.org>, Rob Herring <robh@...nel.org>, Krzysztof Kozlowski
 <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Arnd Bergmann
 <arnd@...db.de>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Saravana
 Kannan <saravanak@...gle.com>, devicetree@...r.kernel.org,
 devicetree-compiler@...r.kernel.org, linux-kernel@...r.kernel.org, Thomas
 Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v2 3/7] of: resolver: Add export_symbols in
 of_resolve_phandles() parameters

Hello Hervé,

On Wed, 30 Apr 2025 14:51:47 +0200
Herve Codina <herve.codina@...tlin.com> wrote:

> In order to prepare the introduction of the export symbols node
> handling, add a export_symbols parameter in of_resolve_phandles().
> 
> The export_symbols is the export symbols device tree node the resolver
> will use for the overlay symbols resolution.
> 
> Signed-off-by: Herve Codina <herve.codina@...tlin.com>
> Tested-by: Ayush Singh <ayush@...gleboard.org>

[...]

> --- a/drivers/of/resolver.c
> +++ b/drivers/of/resolver.c
> @@ -237,7 +237,8 @@ static int get_phandle_from_symbols_node(const struct device_node *tree_symbols,
>  /**
>   * of_resolve_phandles - Relocate and resolve overlay against live tree
>   *
> - * @overlay:	Pointer to devicetree overlay to relocate and resolve
> + * @overlay:		Pointer to devicetree overlay to relocate and resolve
> + * @export_symbols:	Pointer to devicetree export symbols node.
>   *
>   * Modify (relocate) values of local phandles in @overlay to a range that
>   * does not conflict with the live expanded devicetree.  Update references
> @@ -257,6 +258,10 @@ static int get_phandle_from_symbols_node(const struct device_node *tree_symbols,
>   * corresponding to that symbol in the live tree.  Update the references in
>   * the overlay with the phandle values in the live tree.
>   *
> + * @export_symbols can be use in this references update. The resolver tries
> + * first to find a match in the @export_symbols. If not found, it uses the
> + * "__symbol__" node in the live tree.

The rationale behind this logic is not clear to me. I'd have expected
instead this logic:

  if (export-symbols != NULL):
      match only in export-symbols
  else
      match only in __symbols__

following the idea that it's better to be strict when introducing
something, and possibly relax it later on.

As I see it, with the current logic if you use export-symbols but you
build dtbs with -@, you can still match a global label. export-symbols
should avoid that instead.

Let me know whether I'm missing something here (which is surely
possible).

Other than this, the series looks good to me. I'm not adding my R-by on
the implementation patches though, waiting for the above question to be
clarified.

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ