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: <1369947918.2414.28.camel@bwh-desktop.uk.level5networks.com>
Date:	Thu, 30 May 2013 22:05:18 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	David Miller <davem@...emloft.net>
CC:	<David.Laight@...LAB.COM>, <amwang@...hat.com>,
	<netdev@...r.kernel.org>, <horms@...ge.net.au>
Subject: Re: [Patch net-next v3] net: clean up skb headers code

On Thu, 2013-05-30 at 13:16 -0700, David Miller wrote:
> From: "David Laight" <David.Laight@...LAB.COM>
> Date: Thu, 30 May 2013 12:18:13 +0100
> 
> >> commit 1a37e412a0225fcba5587 (net: Use 16bits for *_headers
> >> fields of struct skbuff) converts skb->*_header to u16,
> >> some #if NET_SKBUFF_DATA_USES_OFFSET are now useless,
> >> and to be safe, we could just use "X = ~(typeof(X))0;"
> >> as suggested by David and Ben.
> > 
> > IIRC ~(unsigned short)0 is the same as ~0 and will be -1.
> > define an actual constant with value 0xffff
> 
> The problem with doing that is that if this type is changed again,
> we'lll go through this same circus changing the constant everywhere
> and missing some cases.
> 
> I absolutely want to see a version of this fix that makes sure that if
> the type changes, either the constantly automatically change (that's
> the "typeof(X)" approach) or the build breaks spectacularly until the
> value is fixed up.

Let's just give the 'invalid' value a name and define it right next to
those fields.  It might be worth reintroducing sk_buff_data_t too, since
there was at least one place which wanted to save and restore offsets in
local variables.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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