From: David Ahern <dsahern@gmail.com>
To: Mauricio Faria de Oliveira <mfo@canonical.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net
Subject: Re: [PATCH v2 net-next] rtnetlink: fix rtnl_fdb_dump() for ndmsg header
Date: Thu, 4 Oct 2018 14:34:28 -0600 [thread overview]
Message-ID: <64c1aa20-7e9a-68d5-5c1f-5ab059fc6c9e@gmail.com> (raw)
In-Reply-To: <20181002014640.688-1-mfo@canonical.com>
On 10/1/18 7:46 PM, Mauricio Faria de Oliveira wrote:
> Currently, rtnl_fdb_dump() assumes the family header is 'struct ifinfomsg',
> which is not always true -- 'struct ndmsg' is used by iproute2 ('ip neigh').
>
> The problem is, the function bails out early if nlmsg_parse() fails, which
> does occur for iproute2 usage of 'struct ndmsg' because the payload length
> is shorter than the family header alone (as 'struct ifinfomsg' is assumed).
>
> This breaks backward compatibility with userspace -- nothing is sent back.
>
...
>
> Fixes: 0ff50e83b512 ("net: rtnetlink: bail out from rtnl_fdb_dump() on parse error")
> Fixes: 5e6d24358799 ("bridge: netlink dump interface at par with brctl")
> Reported-by: Aidan Obley <aobley@pivotal.io>
> Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
>
> ---
> v2: Change logic to check msg size for ndmsg with optional attribute.
> Thanks: David Ahern <dsahern@gmail.com>
>
> net/core/rtnetlink.c | 29 ++++++++++++++++++++---------
> 1 file changed, 20 insertions(+), 9 deletions(-)
>
Seems reasonable for 4.19 and back
Reviewed-by: David Ahern <dsahern@gmail.com>
prev parent reply other threads:[~2018-10-05 3:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-02 1:46 [PATCH v2 net-next] rtnetlink: fix rtnl_fdb_dump() for ndmsg header Mauricio Faria de Oliveira
2018-10-04 20:34 ` David Ahern [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=64c1aa20-7e9a-68d5-5c1f-5ab059fc6c9e@gmail.com \
--to=dsahern@gmail.com \
--cc=davem@davemloft.net \
--cc=mfo@canonical.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).