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] [day] [month] [year] [list]
Message-ID: <ZsAzM8K9PnN5jxR9@wunner.de>
Date: Sat, 17 Aug 2024 07:20:51 +0200
From: Lukas Wunner <lukas@...ner.de>
To: Guilherme Giacomo Simoes <trintaeoitogc@...il.com>
Cc: scott@...teful.org, bhelgaas@...gle.com, ilpo.jarvinen@...ux.intel.com,
	wsa+renesas@...g-engineering.com, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org, Nam Cao <namcao@...utronix.de>
Subject: Re: [PATCH] PCI: hotplug: check the return of hotplug bridge

[shorten subject, cc += Nam Cao, start of thread:
https://lore.kernel.org/all/20240817032228.6844-1-trintaeoitogc@gmail.com/
]

On Sat, Aug 17, 2024 at 12:22:27AM -0300, Guilherme Giacomo Simoes wrote:
> Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@...il.com>

Hm, the body of the commit message ended up in the subject
and the patch was submitted twice.


> --- a/drivers/pci/hotplug/shpchp_pci.c
> +++ b/drivers/pci/hotplug/shpchp_pci.c
> @@ -48,8 +48,11 @@ int shpchp_configure_device(struct slot *p_slot)
>  	}
>  
>  	for_each_pci_bridge(dev, parent) {
> -		if (PCI_SLOT(dev->devfn) == p_slot->device)
> -			pci_hp_add_bridge(dev);
> +		if (PCI_SLOT(dev->devfn) == p_slot->device) {
> +			ret = pci_hp_add_bridge(dev);
> +			if (ret)
> +				goto out;
> +		}
>  	}
>  
>  	pci_assign_unassigned_bridge_resources(bridge);

Nam Cao worked on this back in May:

v1:
https://lore.kernel.org/all/cover.1714762038.git.namcao@linutronix.de/

v2:
https://lore.kernel.org/all/cover.1714838173.git.namcao@linutronix.de/

v3:
https://lore.kernel.org/all/cover.1715609848.git.namcao@linutronix.de/

Note that there was discussion on v2 after v3 had been submitted,
i.e. the last messages in the discussion are in the v2 thread.

Nam Cao's patches didn't get applied, I think we hadn't reached
consensus or were waiting for a v4.

Nam Cao's v2 uses the exact same approach that you're proposing
and they subsequently found a way to crash the kernel despite the
newly introduced error handling:

https://lore.kernel.org/all/20240506083701.NZNifFGn@linutronix.de/

So I'm afraid your patch may not work in every scenario.

Thanks,

Lukas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ