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: <20151130.104226.1974076120162436486.davem@redhat.com>
Date:	Mon, 30 Nov 2015 10:42:26 -0500 (EST)
From:	David Miller <davem@...hat.com>
To:	jakub.kicinski@...ronome.com
Cc:	netdev@...r.kernel.org, simon.horman@...ronome.com,
	rolf.neugebauer@...ronome.com
Subject: Re: [PATCH net-next v4 2/2] net: add driver for Netronome
 NFP4000/NFP6000 NIC VFs

From: Jakub Kicinski <jakub.kicinski@...ronome.com>
Date: Wed, 25 Nov 2015 15:39:04 +0000

> +config NFP_NET_DEBUG
> +	bool "Debug support for Netronome(R) NFP3200/NFP6000 NIC drivers"
> +	depends on NFP_NET || NFP_NETVF
> +	---help---
> +	  Enable extra sanity checks and debugfs support in
> +	  Netronome(R) NFP3200/NFP6000 NIC PF and VF drivers.
> +	  Note: selecting this option may adversely impact
> +		performance.
 ...
> +#ifdef CONFIG_NFP_NET_DEBUG
> +#define nn_assert(cond, fmt, args...)					\
> +	do {								\
> +		if (unlikely(!(cond))) {				\
> +			pr_err("assertion %s failed\n", #cond);		\
> +			pr_err(fmt, ## args);				\
> +			BUG();						\
> +		}							\
> +	} while (0)
> +#else
> +#define nn_assert(cond, fmt, args...)	do { } while (0)
> +#endif

This is really not appropriate.

Use WARN_ON() et al. as appropriate to assert things, and in particular
_AVOID_ BUG() in pretty much all cases and attempt to continue running
somehow with error handling paths etc.

Use of BUG() is discouraged in all except the most extreme cases where
the kernel cannot continue to execute at all.

Thanks.
--
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