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: <20240923150036.1ede7ca6@bootlin.com>
Date: Mon, 23 Sep 2024 15:00:36 +0200
From: Herve Codina <herve.codina@...tlin.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Linus Walleij <linus.walleij@...aro.org>, linux-gpio@...r.kernel.org,
 linux-kernel@...r.kernel.org, Bartosz Golaszewski
 <bartosz.golaszewski@...aro.org>, Luca Ceresoli <luca.ceresoli@...tlin.com>
Subject: Re: [PATCH v2] gpio: free irqs that are still requested when the
 chip is being removed

Hi Bartosz,

On Thu, 19 Sep 2024 15:51:04 +0200
Bartosz Golaszewski <brgl@...ev.pl> wrote:

> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> 
> If we remove a GPIO chip that is also an interrupt controller with users
> not having freed some interrupts, we'll end up leaking resources as
> indicated by the following warning:
> 
>   remove_proc_entry: removing non-empty directory 'irq/30', leaking at least 'gpio'
> 
> As there's no way of notifying interrupt users about the irqchip going
> away and the interrupt subsystem is not plugged into the driver model and
> so not all cases can be handled by devlinks, we need to make sure to free
> all interrupts before the complete the removal of the provider.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> ---
> v1 -> v2:
> - we should actually take the request_mutex to protect the irqaction from being
>   freed while we dereference it and keep the actual dereferencing under the lock
> - add some comments to explain what we're doing
> 
>  drivers/gpio/gpiolib.c | 41 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)

Thanks for the patch.
Tested on my system and it fixes the issue.

Reviewed-by: Herve Codina <herve.codina@...tlin.com>
Tested-by: Herve Codina <herve.codina@...tlin.com>

My old series [1] related to the topic is no more needed and can be thrown
away.

Best regards,
Hervé

[1] https://lore.kernel.org/all/20240227113426.253232-1-herve.codina@bootlin.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ