netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jouni Malinen <j@w1.fi>
To: Jouni Malinen <jkmalinen@gmail.com>
Cc: David Ahern <dsahern@gmail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH v2 net-next] net: netlink: Update attr validation to require exact length for some types
Date: Fri, 1 Dec 2017 20:48:26 +0200	[thread overview]
Message-ID: <20171201184826.GA18247@w1.fi> (raw)
In-Reply-To: <CANe27jKPoF6GV6u0CjjYTUq0NrxFAS1ivEbhCtzd4ugEkL9=WA@mail.gmail.com>

Well.. This did not go well with gmail defaults and the mailing list..
Sending this with something safer and plaintext only version to get this
on the mailing list as well:

On Wed, Nov 8, 2017 at 7:59 AM, David Ahern <dsahern@gmail.com> wrote:

> Attributes using NLA_U* and NLA_S* (where * is 8, 16,32 and 64) are
> expected to be an exact length. Split these data types from
> nla_attr_minlen into nla_attr_len and update validate_nla to require
> the attribute to have exact length for them.

While I understand and support this change in general, I have to note that
this resulted in some unfortunate user space regressions that came apparent
when testing Wi-Fi with Linux 4.15-rc1. When a new nl80211 attribute was
added for controlling SMPS modes in 2014 the kernel contribution added this
with NLA_U8 policy while the user space contribution to hostapd used
NLA_PUT_U32. This has apparently been unnoticed until now since the first
byte contained the appropriate value on little endian devices (no one
testing this on big endian hosts?)..

I'll obviously fix the encoding of this attribute in hostapd, but it should
be noted that Linux 4.15 will result in significant functionality issues if
the kernel is updated without a user space fix going in first.

-- 
Jouni Malinen                                            PGP id EFC895FA

      parent reply	other threads:[~2017-12-01 18:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08  5:59 [PATCH v2 net-next] net: netlink: Update attr validation to require exact length for some types David Ahern
2017-11-11  6:15 ` David Miller
     [not found] ` <CANe27jKPoF6GV6u0CjjYTUq0NrxFAS1ivEbhCtzd4ugEkL9=WA@mail.gmail.com>
2017-12-01 18:48   ` Jouni Malinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171201184826.GA18247@w1.fi \
    --to=j@w1.fi \
    --cc=dsahern@gmail.com \
    --cc=jkmalinen@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).