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]
Date:   Wed, 25 Nov 2020 19:50:36 +0100
From:   Andrea Mayer <andrea.mayer@...roma2.it>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     "David S. Miller" <davem@...emloft.net>,
        David Ahern <dsahern@...nel.org>,
        Alexey Kuznetsov <kuznet@....inr.ac.ru>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        Shuah Khan <shuah@...nel.org>,
        Shrijeet Mukherjee <shrijeet@...il.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...omium.org>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        Nathan Chancellor <natechancellor@...il.com>,
        Stefano Salsano <stefano.salsano@...roma2.it>,
        Paolo Lungaroni <paolo.lungaroni@...t.it>,
        Ahmed Abdelsalam <ahabdels.dev@...il.com>,
        Andrea Mayer <andrea.mayer@...roma2.it>
Subject: Re: [net-next v3 5/8] seg6: add support for the SRv6 End.DT4
 behavior

Hi Jakub,
thanks for your review.

On Tue, 24 Nov 2020 15:40:17 -0800
Jakub Kicinski <kuba@...nel.org> wrote:

> On Mon, 23 Nov 2020 19:28:53 +0100 Andrea Mayer wrote:
> > +static int cmp_nla_vrftable(struct seg6_local_lwt *a, struct seg6_local_lwt *b)
> > +{
> > +	struct seg6_end_dt_info *info_a = seg6_possible_end_dt_info(a);
> > +	struct seg6_end_dt_info *info_b = seg6_possible_end_dt_info(b);
> > +
> > +	if (IS_ERR(info_a) || IS_ERR(info_b))
> > +		return 1;
> 
> Isn't this impossible? I thought cmp() can only be called on fully
> created lwtunnels and if !CONFIG_NET_L3_MASTER_DEV the tunnel won't 
> be created?
> 

The function cmp_nla_vrftable() can be called only if the lwtunnel is created
successfully.

A SRv6 behavior using a vrftable attribute can be successfully instantiated only
if CONFIG_NET_L3_MASTER_DEV is set. Otherwise (CONFIG_NET_L3_MASTER_DEV not set),
the function parse_nla_vrftable() returns an error (obtained from the
seg6_possible_end_dt_info()) and tunnel creation fails.

The pointer returned from seg6_possible_end_dt_info() depends on
CONFIG_NET_L3_MASTER_DEV. I thought it would be reasonable to check its validity
in functions that make explicit use of seg6_possible_end_dt_info() even in cases
where this was not strictly necessary (i.e: cmp_nla_vrftable()).

Therefore, it turns out to be an impossible case. I can remove these checks in
the next v4.

Thank you,
Andrea

> > +	if (info_a->vrf_table != info_b->vrf_table)
> > +		return 1;
> > +
> > +	return 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ