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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200928140054.GA11500@willie-the-truck>
Date:   Mon, 28 Sep 2020 15:00:55 +0100
From:   Will Deacon <will@...nel.org>
To:     Baolin Wang <baolin.wang@...ux.alibaba.com>,
        lorenzo.pieralisi@....com
Cc:     catalin.marinas@....com, baolin.wang7@...il.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64: PCI: Validate the node before setting node id for
 root bus

[+ Lorenzo]

On Tue, Sep 22, 2020 at 06:33:24PM +0800, Baolin Wang wrote:
> If the BIOS disabled the NUMA configuration, but did not change the
> proximity domain description in the SRAT table, so the PCI root bus
> device may get a incorrect node id by acpi_get_node().

How "incorrect" are we talking here? What actually goes wrong? At some
point, we have to trust what the firmware is telling us.

> Thus better to add a numa node validation before setting numa node
> for the PCI root bus, like pci_acpi_root_get_node() does for X86
> architecture.
> 
> Signed-off-by: Baolin Wang <baolin.wang@...ux.alibaba.com>
> ---
>  arch/arm64/kernel/pci.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
> index 1006ed2..24fe2bd 100644
> --- a/arch/arm64/kernel/pci.c
> +++ b/arch/arm64/kernel/pci.c
> @@ -86,9 +86,13 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
>  		struct pci_config_window *cfg = bridge->bus->sysdata;
>  		struct acpi_device *adev = to_acpi_device(cfg->parent);
>  		struct device *bus_dev = &bridge->bus->dev;
> +		int node = acpi_get_node(acpi_device_handle(adev));
> +
> +		if (node != NUMA_NO_NODE && !node_online(node))
> +			node = NUMA_NO_NODE;

Hmm. afaict, acpi_get_node() tries quite hard to return a valid node when
it gets back NUMA_NO_NODE in acpi_map_pxm_to_node(). Seems like we're
undoing all of that here, which worries me because NUMA_NO_NODE is a bit
of a loaded gun if you interpret it as a valid node.

Anyway, I defer to Lorenzo on this.

Will

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ