From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Ido Schimmel <idosch@idosch.org>
Cc: "syzbot+9ba1174359adba5a5b7c@syzkaller.appspotmail.com"
<syzbot+9ba1174359adba5a5b7c@syzkaller.appspotmail.com>,
Jiri Pirko <jiri@resnulli.us>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"bridge@lists.linux-foundation.org"
<bridge@lists.linux-foundation.org>,
syzkaller-bugs <syzkaller-bugs@googlegroups.com>,
"nikolay@nvidia.com" <nikolay@nvidia.com>,
Roopa Prabhu <roopa@nvidia.com>, Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [Bridge] [PATCH net] net: bridge: validate the NUD_PERMANENT bit when adding an extern_learn FDB entry
Date: Tue, 10 Aug 2021 10:09:29 +0000 [thread overview]
Message-ID: <20210810100928.uk7dfstrnts2may4@skbuf> (raw)
In-Reply-To: <YRIgynudgTsOpe5q@shredder>
On Tue, Aug 10, 2021 at 09:46:34AM +0300, Ido Schimmel wrote:
> On Mon, Aug 09, 2021 at 04:05:22PM +0000, Vladimir Oltean wrote:
> > On Mon, Aug 09, 2021 at 03:16:40PM +0300, Ido Schimmel wrote:
> > > I have at least once selftest where I forgot the 'static' keyword:
> > >
> > > bridge fdb add de:ad:be:ef:13:37 dev $swp1 master extern_learn vlan 1
> > >
> > > This patch breaks the test when run against both the kernel and hardware
> > > data paths. I don't mind patching these tests, but we might get more
> > > reports in the future.
> >
> > Is it the 'static' keyword that you forgot, or 'dynamic'? The
> > tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh selftest
> > looks to me like it's testing the behavior of an FDB entry which should
> > roam, and which without the extern_learn flag would be ageable.
>
> static - no aging, no roaming
> dynamic - aging, roaming
> extern_learn - no aging, roaming
>
> So these combinations do not make any sense and the kernel will ignore
> static/dynamic when extern_learn is specified. It's needed to work
> around iproute2 behavior of "assume permanent"
Since NTF_EXT_LEARNED is part of ndm->ndm_flags and NUD_REACHABLE/NUD_NOARP
are part of ndm->ndm_state, it is not at all clear to me that 'extern_learn'
belongs to the same class of bridge neighbor attributes as 'static'/'dynamic',
and that it is invalid to have the full degree of freedom. If it isn't,
shouldn't the kernel validate that, instead of just ignoring the ndm->ndm_state?
If it's too late to validate, shouldn't we at least document somewhere
that the ndm_state is ignored in the presence of ndm_flags & NTF_EXT_LEARNED?
It is user API after all, easter eggs like this aren't very enjoyable.
WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Ido Schimmel <idosch@idosch.org>
Cc: "nikolay@nvidia.com" <nikolay@nvidia.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Jiri Pirko <jiri@resnulli.us>, Roopa Prabhu <roopa@nvidia.com>,
"bridge@lists.linux-foundation.org"
<bridge@lists.linux-foundation.org>,
syzkaller-bugs <syzkaller-bugs@googlegroups.com>,
"syzbot+9ba1174359adba5a5b7c@syzkaller.appspotmail.com"
<syzbot+9ba1174359adba5a5b7c@syzkaller.appspotmail.com>
Subject: Re: [PATCH net] net: bridge: validate the NUD_PERMANENT bit when adding an extern_learn FDB entry
Date: Tue, 10 Aug 2021 10:09:29 +0000 [thread overview]
Message-ID: <20210810100928.uk7dfstrnts2may4@skbuf> (raw)
In-Reply-To: <YRIgynudgTsOpe5q@shredder>
On Tue, Aug 10, 2021 at 09:46:34AM +0300, Ido Schimmel wrote:
> On Mon, Aug 09, 2021 at 04:05:22PM +0000, Vladimir Oltean wrote:
> > On Mon, Aug 09, 2021 at 03:16:40PM +0300, Ido Schimmel wrote:
> > > I have at least once selftest where I forgot the 'static' keyword:
> > >
> > > bridge fdb add de:ad:be:ef:13:37 dev $swp1 master extern_learn vlan 1
> > >
> > > This patch breaks the test when run against both the kernel and hardware
> > > data paths. I don't mind patching these tests, but we might get more
> > > reports in the future.
> >
> > Is it the 'static' keyword that you forgot, or 'dynamic'? The
> > tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh selftest
> > looks to me like it's testing the behavior of an FDB entry which should
> > roam, and which without the extern_learn flag would be ageable.
>
> static - no aging, no roaming
> dynamic - aging, roaming
> extern_learn - no aging, roaming
>
> So these combinations do not make any sense and the kernel will ignore
> static/dynamic when extern_learn is specified. It's needed to work
> around iproute2 behavior of "assume permanent"
Since NTF_EXT_LEARNED is part of ndm->ndm_flags and NUD_REACHABLE/NUD_NOARP
are part of ndm->ndm_state, it is not at all clear to me that 'extern_learn'
belongs to the same class of bridge neighbor attributes as 'static'/'dynamic',
and that it is invalid to have the full degree of freedom. If it isn't,
shouldn't the kernel validate that, instead of just ignoring the ndm->ndm_state?
If it's too late to validate, shouldn't we at least document somewhere
that the ndm_state is ignored in the presence of ndm_flags & NTF_EXT_LEARNED?
It is user API after all, easter eggs like this aren't very enjoyable.
next prev parent reply other threads:[~2021-08-10 10:09 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-01 23:17 [Bridge] [PATCH net] net: bridge: validate the NUD_PERMANENT bit when adding an extern_learn FDB entry Vladimir Oltean
2021-08-01 23:17 ` Vladimir Oltean
2021-08-02 7:42 ` [Bridge] " Nikolay Aleksandrov
2021-08-02 7:42 ` Nikolay Aleksandrov
2021-08-02 9:20 ` [Bridge] " Vladimir Oltean
2021-08-02 9:20 ` Vladimir Oltean
2021-08-02 9:42 ` [Bridge] " Nikolay Aleksandrov
2021-08-02 9:42 ` Nikolay Aleksandrov
2021-08-02 10:52 ` [Bridge] " Vladimir Oltean
2021-08-02 10:52 ` Vladimir Oltean
2021-08-02 11:02 ` [Bridge] " Nikolay Aleksandrov
2021-08-02 11:02 ` Nikolay Aleksandrov
2021-08-02 11:20 ` [Bridge] " Vladimir Oltean
2021-08-02 11:20 ` Vladimir Oltean
2021-08-02 11:25 ` [Bridge] " Nikolay Aleksandrov
2021-08-02 11:25 ` Nikolay Aleksandrov
2021-08-02 22:10 ` [Bridge] " patchwork-bot+netdevbpf
2021-08-02 22:10 ` patchwork-bot+netdevbpf
2021-08-09 12:16 ` [Bridge] " Ido Schimmel
2021-08-09 12:16 ` Ido Schimmel
2021-08-09 12:32 ` [Bridge] " Vladimir Oltean
2021-08-09 12:32 ` Vladimir Oltean
2021-08-09 15:33 ` [Bridge] " Nikolay Aleksandrov
2021-08-09 15:33 ` Nikolay Aleksandrov
2021-08-10 6:40 ` [Bridge] " Ido Schimmel
2021-08-10 6:40 ` Ido Schimmel
2021-08-10 7:21 ` [Bridge] [PATCH net] net: bridge: fix flags interpretation for extern learn fdb entries Nikolay Aleksandrov
2021-08-10 7:21 ` Nikolay Aleksandrov
2021-08-10 11:00 ` [Bridge] [PATCH net v2] " Nikolay Aleksandrov
2021-08-10 11:00 ` Nikolay Aleksandrov
2021-08-10 13:50 ` [Bridge] " Vladimir Oltean
2021-08-10 13:50 ` Vladimir Oltean
2021-08-10 20:20 ` [Bridge] " patchwork-bot+netdevbpf
2021-08-10 20:20 ` patchwork-bot+netdevbpf
2021-08-09 16:05 ` [Bridge] [PATCH net] net: bridge: validate the NUD_PERMANENT bit when adding an extern_learn FDB entry Vladimir Oltean
2021-08-09 16:05 ` Vladimir Oltean
2021-08-10 6:46 ` [Bridge] " Ido Schimmel
2021-08-10 6:46 ` Ido Schimmel
2021-08-10 10:09 ` Vladimir Oltean [this message]
2021-08-10 10:09 ` Vladimir Oltean
2021-08-10 10:15 ` [Bridge] " Nikolay Aleksandrov
2021-08-10 10:15 ` Nikolay Aleksandrov
2021-08-10 10:38 ` [Bridge] " Vladimir Oltean
2021-08-10 10:38 ` Vladimir Oltean
2021-08-10 10:43 ` [Bridge] " Nikolay Aleksandrov
2021-08-10 10:43 ` Nikolay Aleksandrov
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=20210810100928.uk7dfstrnts2may4@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=idosch@idosch.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikolay@nvidia.com \
--cc=roopa@nvidia.com \
--cc=syzbot+9ba1174359adba5a5b7c@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.