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]
Date:   Tue, 11 Aug 2020 21:21:49 +0200
From:   "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
To:     Guenter Roeck <linux@...ck-us.net>,
        Thomas Gleixner <tglx@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, Linux PM <linux-pm@...r.kernel.org>,
        linux-acpi <linux-acpi@...el.com>, rafael@...nel.org
Subject: Re: [PATCH] genirq/PM: Always unlock IRQ descriptor in rearm_wake_irq

On 8/11/2020 8:00 PM, Guenter Roeck wrote:
> rearm_wake_irq() does not unlock the irq descriptor if the interrupt
> is not suspended or if wakeup is not enabled on it. Fix it.
>
> Fixes: 3a79bc63d9075 ("PCI: irq: Introduce rearm_wake_irq()")
> Cc: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

And it needs to go to -stable (even though the bug is latent now, 
because this function is called for suspended IRQs only AFAICS).

Or I can apply this as the mistake was in my commit.  Please let me know 
what you prefer.


> ---
>   kernel/irq/pm.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c
> index 8f557fa1f4fe..c6c7e187ae74 100644
> --- a/kernel/irq/pm.c
> +++ b/kernel/irq/pm.c
> @@ -185,14 +185,18 @@ void rearm_wake_irq(unsigned int irq)
>   	unsigned long flags;
>   	struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
>   
> -	if (!desc || !(desc->istate & IRQS_SUSPENDED) ||
> -	    !irqd_is_wakeup_set(&desc->irq_data))
> +	if (!desc)
>   		return;
>   
> +	if (!(desc->istate & IRQS_SUSPENDED) ||
> +	    !irqd_is_wakeup_set(&desc->irq_data))
> +		goto unlock;
> +
>   	desc->istate &= ~IRQS_SUSPENDED;
>   	irqd_set(&desc->irq_data, IRQD_WAKEUP_ARMED);
>   	__enable_irq(desc);
>   
> +unlock:
>   	irq_put_desc_busunlock(desc, flags);
>   }
>   


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ