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: <87plnx8yot.ffs@tglx>
Date: Fri, 18 Oct 2024 12:58:42 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: quic_zijuhu <quic_zijuhu@...cinc.com>, Zijun Hu <zijun_hu@...oud.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] genirq/devres: Simplify API devm_free_irq() implementation

On Fri, Oct 18 2024 at 17:28, quic zijuhu wrote:
> On 10/18/2024 4:57 PM, Thomas Gleixner wrote:
> if irq to free was ever requested by devm_request_irq()
> then both logic is exactly same.
>
> otherwise, actually change devres_free_irq()'s logic from
>
> if (irq is not requested by devm_request_irq() {
> 	warn;
> }
> free_irq()
>
> To
>
> if (irq is not requested by devm_request_irq() {
> 	warn;
> 	return;
> }
>

Ah, you are right. I thought there is a return there.

So you want to explain it maybe this way:

   If devres_destroy() does not find a matching devres entry, then
   devm_free_irq() emits a warning and tries to free the interrupt.

   That's wrong as devm_free_irq() should only undo what
   devm_request_irq() set up.

   Replace devres_destroy() with a call to devres_release() which only
   invokes the release function (free_irq()) in case that a matching
   devres entry was found.

Or something like that.

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ