Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1470119

Re: CVE-2014-9900 fix is not upstream

From Johannes Berg <johannes@sipsolutions.net>
Newsgroups linux.kernel
Subject Re: CVE-2014-9900 fix is not upstream
Date 2016-08-25 14:50 +0200
Message-ID <sa2gx-11v-5@gated-at.bofh.it> (permalink)
References (7 earlier) <s9rqF-18W-9@gated-at.bofh.it> <s9H2q-3m5-17@gated-at.bofh.it> <s9N7Q-7tx-7@gated-at.bofh.it> <sa2gx-11v-3@gated-at.bofh.it> <s9N7Q-7tx-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> If we want to go down this route, probably the only option is to add
> __attribute__((pack)) those structs to just have no padding at all,
> thus breaking uapi.
> 

We could also spell out the padding bytes as reserved, i.e. instead of

struct ethtool_wolinfo {
        __u32   cmd;
        __u32   supported;
        __u32   wolopts;
        __u8    sopass[SOPASS_MAX];     // 6, actually
};

we could do

struct ethtool_wolinfo {
        __u32   cmd;
        __u32   supported;
        __u32   wolopts;
        __u8    sopass[SOPASS_MAX];     // 6, actually
	__u8	reserved[2];
};

and then the compiler has to properly treat it, since it's no longer
unnamed padding.

Maybe somebody can come up with a smart BUILD_BUG_ON() to ensure such
structs have no padding.

That would allow us to keep the C99 initializers (which is nice) and
not have to worry about this.

johannes

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

CVE-2014-9900 fix is not upstream Luis Henriques <luis.henriques@canonical.com> - 2016-08-23 15:50 +0200
  net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Luis Henriques <luis.henriques@canonical.com> - 2016-08-23 15:50 +0200
    Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Joe Perches <joe@perches.com> - 2016-08-23 16:20 +0200
      Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Joe Perches <joe@perches.com> - 2016-08-23 17:50 +0200
    Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Eric Dumazet <eric.dumazet@gmail.com> - 2016-08-23 16:50 +0200
      Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Joe Perches <joe@perches.com> - 2016-08-23 17:30 +0200
        Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Eric Dumazet <eric.dumazet@gmail.com> - 2016-08-23 17:40 +0200
          Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-08-23 18:40 +0200
          Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Edward Cree <ecree@solarflare.com> - 2016-08-23 19:00 +0200
        Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Vegard Nossum <vegard.nossum@gmail.com> - 2016-08-23 19:20 +0200
      Re: net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() Ben Hutchings <ben@decadent.org.uk> - 2016-08-23 19:40 +0200
  Re: CVE-2014-9900 fix is not upstream David Miller <davem@davemloft.net> - 2016-08-23 18:50 +0200
    Re: CVE-2014-9900 fix is not upstream Ben Hutchings <ben@decadent.org.uk> - 2016-08-23 19:40 +0200
      Re: CVE-2014-9900 fix is not upstream David Miller <davem@davemloft.net> - 2016-08-23 20:30 +0200
        Re: CVE-2014-9900 fix is not upstream Al Viro <viro@ZenIV.linux.org.uk> - 2016-08-23 22:20 +0200
          Re: CVE-2014-9900 fix is not upstream Joe Perches <joe@perches.com> - 2016-08-23 22:40 +0200
            Re: CVE-2014-9900 fix is not upstream lsorense@csclub.uwaterloo.ca (Lennart Sorensen) - 2016-08-23 23:00 +0200
              Re: CVE-2014-9900 fix is not upstream Al Viro <viro@ZenIV.linux.org.uk> - 2016-08-23 23:30 +0200
                Re: CVE-2014-9900 fix is not upstream lsorense@csclub.uwaterloo.ca (Lennart Sorensen) - 2016-08-24 16:10 +0200
                Re: CVE-2014-9900 fix is not upstream Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-08-24 22:40 +0200
                Re: CVE-2014-9900 fix is not upstream Johannes Berg <johannes@sipsolutions.net> - 2016-08-25 14:50 +0200
                Re: CVE-2014-9900 fix is not upstream Johannes Berg <johannes@sipsolutions.net> - 2016-08-25 14:50 +0200
                Re: CVE-2014-9900 fix is not upstream One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-08-25 18:20 +0200

csiph-web