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: <20250128141242.pog2tuorvqmobain@thinkpad>
Date: Tue, 28 Jan 2025 19:42:42 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>
Cc: Krzysztof Wilczy���ski <kw@...ux.com>,
	Kishon Vijay Abraham I <kishon@...nel.org>,
	Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Lorenzo Pieralisi <lpieralisi@...nel.org>,
	Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
	Bjorn Helgaas <helgaas@...nel.org>, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH v2 1/3] misc: pci_endpoint_test: Avoid issue of
 interrupts remaining after request_irq error

On Wed, Jan 22, 2025 at 11:24:44AM +0900, Kunihiko Hayashi wrote:
> After devm_request_irq() fails with error,
> pci_endpoint_test_free_irq_vectors() is called to free allocated vectors
> with pci_free_irq_vectors().
> 

You should mention the function name which you are referring to. Here it is,
pci_endpoint_test_request_irq().

> However some requested IRQs are still allocated, so there are still

This is confusing. Are you saying that the previously requested IRQs are not
freed when an error happens during the for loop in
pci_endpoint_test_request_irq()?

> /proc/irq/* entries remaining and we encounters WARN() with the following
> message:
> 
>     remove_proc_entry: removing non-empty directory 'irq/30', leaking at
>     least 'pci-endpoint-test.0'
>     WARNING: CPU: 0 PID: 80 at fs/proc/generic.c:717 remove_proc_entry
>     +0x190/0x19c

When did you encounter this WARN?

> 
> To solve this issue, set the number of remaining IRQs and release the IRQs
> in advance by calling pci_endpoint_test_release_irq().
> 

First of all, using devm_request_irq() is wrong here as
pci_endpoint_test_request_irq() might be called multiple times by the userspace.
So we cannot use managed version of request_irq(). It is infact pointless since
pci_endpoint_test_clear_irq() would free them anyway. Instead we should just use
request_irq() and call pci_endpoint_test_clear_irq() in the error path as like
this patch does.

But this should be a separate patch.

- Mani

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ