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: <20150408062849.GA23925@gmail.com>
Date:	Wed, 8 Apr 2015 08:28:49 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Seiichi Ikarashi <s.ikarashi@...fujitsu.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	linux-kernel@...r.kernel.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH] irq: Remove unnecessary warning with affinity_hint


* Seiichi Ikarashi <s.ikarashi@...fujitsu.com> wrote:

> Hi,
> 
> If you turn off a PCI device whose driver has set affinity_hint,
> you will get warning message which does _not_ explain the reason
> why it appeared from the user's point of view.
> 
>   # echo 0 > /sys/bus/pci/slots/65/power
> 
>   Apr 28 20:29:39 localhost kernel: ------------[ cut here ]------------
>   Apr 28 20:29:39 localhost kernel: WARNING: at kernel/irq/manage.c:1002 __free_irq+0x22d/0x250() (Tainted: P           ---------------   )
>   (snip)
> 
> Users will misunderstand some problem has happened
> even though he or she succeeded to turn off the device.
> I suppose this warning was originally for a debug purpose
> for driver developers and has incidentally been left.
> 
> Just remove the warning is good and enough.
> 
> Signed-off-by: Seiichi Ikarashi <s.ikarashi@...fujitsu.com>
> 
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -1335,7 +1335,7 @@ static struct irqaction *__free_irq(unsi
>  
>  #ifdef CONFIG_SMP
>  	/* make sure affinity_hint is cleaned up */
> -	if (WARN_ON_ONCE(desc->affinity_hint))
> +	if (desc->affinity_hint)
>  		desc->affinity_hint = NULL;

Well, drivers that are using irq_set_affinity_hint() are expected to 
call:

	irq_set_affinity_hint(irq, NULL);

to clear the affinity mask, before releasing the irq. This warning 
flags drivers that forgot to do that and which might thus leak a 
dynamically allocated CPU mask (and/or other resources).

Feel free to turn the warning message into a more informative WARN() 
that will blame the driver that triggered it, if the stack dump into 
the driver wasn't a clue enough ...

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ