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] [day] [month] [year] [list]
Date:	Mon, 02 Mar 2015 22:00:27 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	fw@...len.de
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH] net: bridge: add compile-time assert for cb struct size

From: Florian Westphal <fw@...len.de>
Date: Tue,  3 Mar 2015 03:50:22 +0100

> @@ -188,8 +188,11 @@ static const struct stp_proto br_stp_proto = {
>  
>  static int __init br_init(void)
>  {
> +	struct sk_buff *skb;
>  	int err;
>  
> +	BUILD_BUG_ON(sizeof(struct br_input_skb_cb) > sizeof(skb->cb));
> +
>  	err = stp_proto_register(&br_stp_proto);
>  	if (err < 0) {
>  		pr_err("bridge: can't register sap for STP\n");

The canonical way to do this, unless you needed the 'skb' variable
for another reason, is to use FIELD_SIZEOF().
--
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