netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Christian Brauner <christian@brauner.io>,
	jbenc@redhat.com, davem@davemloft.net,
	stephen@networkplumber.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 0/7] rtnetlink: add RTM_GETADDR2
Date: Thu, 27 Sep 2018 14:24:36 -0600	[thread overview]
Message-ID: <e7ec6202-7d4b-8dc1-1b25-76325129ba6f@gmail.com> (raw)
In-Reply-To: <20180927175857.3511-1-christian@brauner.io>

On 9/27/18 11:58 AM, Christian Brauner wrote:
> Various userspace programs (e.g. iproute2) have sent RTM_GETADDR
> requests with struct ifinfomsg. This is wrong and should have been
> struct ifaddrmsg all along as mandated by the manpages. However, dump
> requests so far didn't parse the netlink message that was sent and
> succeeded even when a wrong struct was passed along.

...

> The correct solution at this point seems to me to introduce a new
> RTM_GETADDR2 request. This way we can parse the message and fail hard if
> the struct is not struct ifaddrmsg and can safely extend it in the
> future. Userspace tools that rely on the buggy RTM_GETADDR API will
> still keep working without even having to see any log messages and new
> userspace tools that want to make user of new features can make use of
> the new RTM_GETADDR2 requests.

First, I think this is the wrong precedent when all we need is a single
bit flag that userspace can use to tell the kernel "I have a clue and I
am passing in the proper header for this dump request".

Second, you are not addressing the problems of the past by requiring the
proper header and checking values passed in it.

I have another idea. I'll send an RFC patch soon.

  parent reply	other threads:[~2018-09-27 20:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-27 17:58 [PATCH net-next 0/7] rtnetlink: add RTM_GETADDR2 Christian Brauner
2018-09-27 17:58 ` [PATCH net-next 1/7] " Christian Brauner
2018-09-27 17:58 ` [PATCH net-next 2/7] ipv4: " Christian Brauner
2018-09-27 17:58 ` [PATCH net-next 3/7] ipv6: " Christian Brauner
2018-09-27 17:58 ` [PATCH net-next 4/7] decnet: " Christian Brauner
2018-09-27 17:58 ` [PATCH net-next 5/7] phonet: " Christian Brauner
2018-09-27 17:58 ` [PATCH net-next 6/7] selinux: " Christian Brauner
2018-09-27 17:58 ` [PATCH net-next 7/7] rtnetlink: enable RTM_GETADDR2 Christian Brauner
2018-09-27 20:24 ` David Ahern [this message]
2018-09-27 20:31   ` [PATCH net-next 0/7] rtnetlink: add RTM_GETADDR2 Christian Brauner

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=e7ec6202-7d4b-8dc1-1b25-76325129ba6f@gmail.com \
    --to=dsahern@gmail.com \
    --cc=christian@brauner.io \
    --cc=davem@davemloft.net \
    --cc=jbenc@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.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).