public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl•cc>
To: Michal Kubecek <mkubecek@suse•cz>
Cc: David Miller <davem@davemloft•net>,
	laforge@gnumonks•org, fw@strlen•de, daniel@iogearbox•net,
	netdev@vger•kernel.org, netfilter-devel@vger•kernel.org,
	alexei.starovoitov@gmail•com
Subject: Re: [PATCH RFC 0/4] net: add bpfilter
Date: Tue, 20 Feb 2018 19:10:03 +0100	[thread overview]
Message-ID: <20180220181003.GA9093@orbyte.nwl.cc> (raw)
In-Reply-To: <20180220093541.72verf6szrnzbli7@unicorn.suse.cz>

Hi Michal,

On Tue, Feb 20, 2018 at 10:35:41AM +0100, Michal Kubecek wrote:
> On Mon, Feb 19, 2018 at 06:09:39PM +0100, Phil Sutter wrote:
> > What puzzles me about your argumentation is that you seem to propose for
> > the kernel to cover up flaws in userspace. Spinning this concept further
> > would mean that if there would be an old bug in iproute2 we should think
> > of adding a workaround to rtnetlink interface in kernel because
> > containers will keep the old iproute2 binary? Or am I (hopefully) just
> > missing your point?
> 
> Actually, that's what we already do. This is from rtnl_dump_ifinfo():
> 
> 	/* A hack to preserve kernel<->userspace interface.
> 	 * The correct header is ifinfomsg. It is consistent with rtnl_getlink.
> 	 * However, before Linux v3.9 the code here assumed rtgenmsg and that's
> 	 * what iproute2 < v3.9.0 used.
> 	 * We can detect the old iproute2. Even including the IFLA_EXT_MASK
> 	 * attribute, its netlink message is shorter than struct ifinfomsg.
> 	 */

The reason why this is in place (and should be IMHO) is that commit
88c5b5ce5cb57 ("rtnetlink: Call nlmsg_parse() with correct header
length") incompatibly changed uAPI.

I have a different example which reflects what I have in mind, namely
iproute2 commit 33f6dd23a51c4 ("ip fou: pass family attribute as u8")
which basically does:

| -       addattr16(n, 1024, FOU_ATTR_AF, family);
| +       addattr8(n, 1024, FOU_ATTR_AF, family);

If kernel cares about those userspace bugs, shouldn't the better fix be
to make it expect u16 in FOU_ATTR_AF and check whether the high or low
byte contains the expected value?

Cheers, Phil

  reply	other threads:[~2018-02-20 18:10 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16 13:40 [PATCH RFC 0/4] net: add bpfilter Daniel Borkmann
2018-02-16 13:40 ` [PATCH RFC 1/4] modules: allow insmod load regular elf binaries Daniel Borkmann
2018-02-16 13:40 ` [PATCH RFC 2/4] bpf: introduce bpfilter commands Daniel Borkmann
2018-02-16 13:40 ` [PATCH RFC 3/4] net: initial bpfilter skeleton Daniel Borkmann
2018-02-16 13:40 ` [PATCH RFC 4/4] bpf: rough bpfilter codegen example hack Daniel Borkmann
2018-02-16 14:57 ` [PATCH RFC 0/4] net: add bpfilter Florian Westphal
2018-02-16 16:14   ` Florian Westphal
2018-02-16 20:44     ` Daniel Borkmann
2018-02-17 12:33       ` Harald Welte
2018-02-17 19:18       ` Florian Westphal
2018-02-16 22:33     ` David Miller
2018-02-17 12:21       ` Harald Welte
2018-02-17 20:10       ` Florian Westphal
2018-02-17 22:38         ` Florian Westphal
2018-02-16 16:53   ` Daniel Borkmann
2018-02-16 22:32   ` David Miller
2018-02-17 12:11 ` Harald Welte
2018-02-18  0:35   ` Florian Westphal
2018-02-19 12:03   ` Daniel Borkmann
2018-02-19 12:52     ` Harald Welte
2018-02-19 14:44       ` David Miller
2018-02-19 14:53         ` Florian Westphal
2018-02-19 15:07           ` David Miller
2018-02-19 15:20             ` Florian Westphal
2018-02-19 15:28               ` David Miller
2018-02-19 15:23         ` Harald Welte
2018-02-19 15:32           ` David Miller
2018-02-19 15:37             ` Jan Engelhardt
2018-02-19 15:43               ` David Miller
2018-02-19 15:36           ` David Miller
2018-02-19 17:20             ` Harald Welte
2018-02-19 17:29               ` David Miller
2018-02-19 18:37                 ` Harald Welte
2018-02-19 18:47                   ` David Miller
2018-02-19 17:40             ` Arturo Borrero Gonzalez
2018-02-19 18:06             ` Arturo Borrero Gonzalez
2018-02-19 18:43               ` David Miller
2018-02-19 15:00     ` David Miller
2018-02-19 14:59       ` Florian Westphal
2018-02-19 15:13         ` David Miller
2018-02-19 15:15           ` Florian Westphal
2018-02-19 15:27             ` David Miller
2018-02-19 15:38               ` Harald Welte
2018-02-19 15:44                 ` David Miller
2018-02-19 17:14                   ` Phil Sutter
2018-02-19 17:22                     ` David Miller
2018-02-19 18:05                       ` Phil Sutter
2018-02-19 18:41                         ` David Miller
2018-02-19 20:41                           ` Phil Sutter
2018-02-19 21:13                       ` Florian Westphal
2018-02-20 10:44                       ` Pablo Neira Ayuso
2018-02-20 14:07                         ` Daniel Borkmann
2018-02-20 14:55                         ` David Miller
2018-02-21  1:52                         ` Alexei Starovoitov
2018-02-21 12:01                           ` Pablo Neira Ayuso
2018-02-21 12:13                             ` Florian Westphal
2018-02-22  2:20                               ` nft/bpf interpreters and spectre2. Was: " Alexei Starovoitov
2018-02-22 11:39                                 ` Pablo Neira Ayuso
2018-02-22 17:06                                   ` Alexei Starovoitov
2018-02-22 18:47                                     ` Jann Horn
2018-02-19 17:41               ` Arturo Borrero Gonzalez
2018-02-19 21:30             ` Jozsef Kadlecsik
2018-02-19 15:27           ` Harald Welte
2018-02-19 15:31             ` David Miller
2018-02-19 17:09               ` Phil Sutter
2018-02-19 17:15                 ` David Miller
2018-02-20 13:05                   ` Phil Sutter
2018-02-20  9:35                 ` Michal Kubecek
2018-02-20 18:10                   ` Phil Sutter [this message]
2018-02-19 17:32               ` Harald Welte
2018-02-19 17:41               ` Arturo Borrero Gonzalez
2018-02-19 21:42   ` Willem de Bruijn
2018-02-18 23:35 ` Florian Westphal

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=20180220181003.GA9093@orbyte.nwl.cc \
    --to=phil@nwl$(echo .)cc \
    --cc=alexei.starovoitov@gmail$(echo .)com \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=fw@strlen$(echo .)de \
    --cc=laforge@gnumonks$(echo .)org \
    --cc=mkubecek@suse$(echo .)cz \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=netfilter-devel@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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