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:	Wed, 07 May 2014 15:39:25 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	nikolay@...hat.com
Cc:	netdev@...r.kernel.org, linux-net-drivers@...arflare.com,
	sshah@...arflare.com
Subject: Re: [PATCH net] sfc: fix calling of free_irq with 0 argument

From: Nikolay Aleksandrov <nikolay@...hat.com>
Date: Tue,  6 May 2014 14:49:16 +0200

> If the sfc driver is in legacy interrupt mode (either explicitly by
> using interrupt_mode module param or by falling back to it) it will
> hit a warning at kernel/irq/manage.c because it will try to free irq 0
> in efx_nic_fini_interrupt() since the MSI interrupts were freed always,
> but in legacy irq mode they're == 0. So fix it by checking if we
> actually have an interrupt allocated and only then free it.
> 
> CC: <linux-net-drivers@...arflare.com>
> CC: Shradha Shah <sshah@...arflare.com>
> CC: David S. Miller <davem@...emloft.net>
> 
> Reported-by: Zenghui Shi <zshi@...hat.com>
> Signed-off-by: Nikolay Aleksandrov <nikolay@...hat.com>
> ---
> There're other ways to fix this as well, but I chose this one as it follows
> the logic in the code. Also I saw it used in a few places to check if
> there's an IRQ allocated for that channel.

Zero can be a valid interrupt on some systems.

This is a discussion that keeps popping up from time to time, and Linus
usually gets upset when someone adds a "!irq" test somewhere.

Why not just guard the efx_for_each_channel() loop with a top-level
test of whether we are using legacy interrupt mode?  That will avoid
this issue entirely.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ