[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160823212545.GC2356@ZenIV.linux.org.uk>
Date: Tue, 23 Aug 2016 22:25:45 +0100
From: Al Viro <viro@...IV.linux.org.uk>
To: Lennart Sorensen <lsorense@...lub.uwaterloo.ca>
Cc: Joe Perches <joe@...ches.com>, David Miller <davem@...emloft.net>,
ben@...adent.org.uk, luis.henriques@...onical.com,
avijitnsec@...eaurora.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: CVE-2014-9900 fix is not upstream
On Tue, Aug 23, 2016 at 04:49:33PM -0400, Lennart Sorensen wrote:
> That would be padding after the structure elements.
>
> I think what was meant is that it won't add padding in the middle of the
> structure due to alignment, ie it isn't doing:
>
> struct ethtool_wolinfo {
> __u32 cmd; /* 0 4 */
> __u32 supported; /* 4 4 */
> __u32 wolopts; /* 8 4 */
> <4 bytes padding here>
> __u8 sopass[6]; /* 16 6 */
> };
>
> which would have 4 bytes of padding in the middle between wolopts
> and sopass.
>
> I would not think it is the compilers job to worry about what is after
> your structure elements, since you shouldn't be going there.
Sadly, sizeof is what we use when copying that sucker to userland. So these
padding bits in the end would've leaked, true enough, and the case is somewhat
weaker. And any normal architecture will have those, but then any such
architecture will have no more trouble zeroing a 32bit value than 16bit one.
Powered by blists - more mailing lists