netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, j@w1.fi,
	dsahern-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH net 1/2] netlink: add NLA_U8_BUGGY attribute type
Date: Tue, 05 Dec 2017 17:34:21 +0100	[thread overview]
Message-ID: <1512491661.26976.19.camel@sipsolutions.net> (raw)
In-Reply-To: <20171205.113145.172521292247335321.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

On Tue, 2017-12-05 at 11:31 -0500, David Miller wrote:
> 
> > We could try to fix up the big endian problem here, but we
> > don't know *how* userspace misbehaved - if using nla_put_u32
> > then we could, but we also found a debug tool (which we'll
> > ignore for the purposes of this regression) that was putting
> > the padding into the length.

> We're stuck with this thing forever... I'd like to consider other
> options.
> 
> I've seen this problem at least one time before, therefore I
> suggest when we see a U8 attribute with a U32's length:
> 
> 1) We access it as a u32, this takes care of all endianness
>    issues.

Possible, but as I said above, I've seen at least one tool (a debug
only script) now that will actually emit a U8 followed by 3 bytes of
padding to make it netlink-aligned, but set the length to 4. That would
be broken by making this change.

I'm not saying this is bad - but there are different levels of
compatibility and I'd probably go for "bug compatibility" here rather
than "fix-it-up compatibility".

Your call, ultimately - I've already fixed the tool I had found :-)

> 2) We emit a warning so that the app gets fixes.

For sure.

johannes

  parent reply	other threads:[~2017-12-05 16:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-02 20:23 [PATCH net 1/2] netlink: add NLA_U8_BUGGY attribute type Johannes Berg
2017-12-02 20:23 ` [PATCH net 2/2] nl80211: use NLA_U8_BUGGY for two attributes Johannes Berg
     [not found] ` <20171202202332.10205-1-johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2017-12-02 22:48   ` [PATCH net 1/2] netlink: add NLA_U8_BUGGY attribute type David Ahern
2017-12-05 16:31 ` David Miller
     [not found]   ` <20171205.113145.172521292247335321.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2017-12-05 16:34     ` Johannes Berg [this message]
2017-12-05 16:41       ` David Miller
2017-12-05 17:30         ` Johannes Berg
2017-12-05 17:40           ` David Miller
     [not found]             ` <20171205.124038.2265447675450126665.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2017-12-05 18:15               ` David Ahern
2017-12-05 19:08                 ` David Miller
2017-12-05 16:41       ` David Ahern
     [not found]         ` <fe8e7ad5-9579-31ce-0d02-a6c8522ba366-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-05 16:51           ` David Miller

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=1512491661.26976.19.camel@sipsolutions.net \
    --to=johannes-cdvu00un1vgdhxzaddlk8q@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=dsahern-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=j@w1.fi \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).