lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190605040549.GB18865@dhcp-12-139.nay.redhat.com>
Date:   Wed, 5 Jun 2019 12:05:49 +0800
From:   Hangbin Liu <liuhangbin@...il.com>
To:     Lorenzo Colitti <lorenzo@...gle.com>
Cc:     David Ahern <dsahern@...il.com>,
        David Miller <davem@...emloft.net>,
        Yaro Slav <yaro330@...il.com>,
        Thomas Haller <thaller@...hat.com>,
        Alistair Strachan <astrachan@...gle.com>,
        Greg KH <greg@...ah.com>,
        Linux NetDev <netdev@...r.kernel.org>,
        David Ahern <dsa@...ulusnetworks.com>,
        Maciej Żenczykowski <zenczykowski@...il.com>
Subject: Re: [PATCH net] fib_rules: return 0 directly if an exactly same rule
 exists when NLM_F_EXCL not supplied

On Wed, Jun 05, 2019 at 12:43:44PM +0900, Lorenzo Colitti wrote:
> On Wed, Jun 5, 2019 at 12:29 PM Hangbin Liu <liuhangbin@...il.com> wrote:
> > > We rely on being able to add a rule and either have a dup be created
> > > (in which case we'll remove it later) or have it fail with EEXIST (in
> > > which case we won't remove it later).
> >
> > With Maciej said, how about add NLM_F_EXCL flag when you add a new rule.
> > If it returned EEXIST, which means there is an dup rule, you just do not
> > remove it later.
> >
> > Would that fix your issue?
> 
> We can't do that without rewriting our code and making it more
> complex. The way the code is structured is that an update is "add all
> new rules; delete all old rules". To do what you suggest we would need
> to either change that to "for rule in rules; add newrule; delete
> oldrule" or we'd need to keep state on which rules already existed.

Hmm...Generally speaking we need to check the cmd's return value, or why it
exists.

> 
> The previous behaviour provided semantics that are useful to
> userspace, and this commit broke those semantics. Please revert.

Keep two exactally same rules in kernel looks strange and doesn't make
sense to me. But let's see what does David Ahern think, he is more
experienced in this part :)

Thanks
Hangbin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ