public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Vlad Buslov <vladbu@mellanox•com>
To: Cong Wang <xiyou.wangcong@gmail•com>
Cc: Linux Kernel Network Developers <netdev@vger•kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu•com>,
	Jiri Pirko <jiri@resnulli•us>, David Miller <davem@davemloft•net>
Subject: Re: [PATCH net-next] net: sched: set dedicated tcf_walker flag when tp is empty
Date: Wed, 27 Feb 2019 14:28:42 +0000	[thread overview]
Message-ID: <vbfy361i9uy.fsf@mellanox.com> (raw)
In-Reply-To: <CAM_iQpVjFKwwniiFKy5ocRQ-HB=xzm-Lj6pGihFGXV6Cwj8TVQ@mail.gmail.com>


On Tue 26 Feb 2019 at 22:38, Cong Wang <xiyou.wangcong@gmail•com> wrote:
> On Tue, Feb 26, 2019 at 7:08 AM Vlad Buslov <vladbu@mellanox•com> wrote:
>>
>>
>> On Mon 25 Feb 2019 at 22:52, Cong Wang <xiyou.wangcong@gmail•com> wrote:
>> > On Mon, Feb 25, 2019 at 7:38 AM Vlad Buslov <vladbu@mellanox•com> wrote:
>> >>
>> >> Using tcf_walker->stop flag to determine when tcf_walker->fn() was called
>> >> at least once is unreliable. Some classifiers set 'stop' flag on error
>> >> before calling walker callback, other classifiers used to call it with NULL
>> >> filter pointer when empty. In order to prevent further regressions, extend
>> >> tcf_walker structure with dedicated 'nonempty' flag. Set this flag in
>> >> tcf_walker->fn() implementation that is used to check if classifier has
>> >> filters configured.
>> >
>> >
>> > So, after this patch commits like 31a998487641 ("net: sched: fw: don't
>> > set arg->stop in fw_walk() when empty") can be reverted??
>>
>> Yes, it is safe now to revert following commits:
>>
>> 3027ff41f67c ("net: sched: route: don't set arg->stop in route4_walk() when empty")
>> 31a998487641 ("net: sched: fw: don't set arg->stop in fw_walk() when empty")
>
> Yeah, and probably commit d66022cd1623
> ("net: sched: matchall: verify that filter is not NULL in mall_walk()").
>
> Please send a patch to revert them all.
>
> Thanks.

I think commit d66022cd1623 ("net: sched: matchall: verify that filter
is not NULL in mall_walk()") and commit 8b58d12f4ae1 ("net: sched:
cgroup: verify that filter is not NULL during walk") shouldn't be
reverted. They are still necessary to prevent tcf_chain_dump() from
dumping NULL filter pointer. It can happen when dump is initiated in
parallel with inserting first filter to unlocked classifier.
tcf_fill_node() verifies that filter pointer is not NULL, so it will not
crash, but will output tcf_proto info for second time. This might
"confuse" user-space.

What do you think?

  reply	other threads:[~2019-02-27 14:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 15:38 [PATCH net-next] net: sched: set dedicated tcf_walker flag when tp is empty Vlad Buslov
2019-02-25 18:18 ` David Miller
2019-02-25 22:52 ` Cong Wang
2019-02-26 15:08   ` Vlad Buslov
2019-02-26 22:38     ` Cong Wang
2019-02-27 14:28       ` Vlad Buslov [this message]
2019-02-27 23:09         ` Cong Wang
2019-02-28 15:49           ` Vlad Buslov
2019-03-02  1:17             ` Cong Wang
2019-03-04 13:57               ` Vlad Buslov

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=vbfy361i9uy.fsf@mellanox.com \
    --to=vladbu@mellanox$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=jhs@mojatatu$(echo .)com \
    --cc=jiri@resnulli$(echo .)us \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=xiyou.wangcong@gmail$(echo .)com \
    /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