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: <YP3tOORtoNHZXQdt@horizon.localdomain>
Date:   Sun, 25 Jul 2021 20:01:12 -0300
From:   Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
To:     Chen Shen <peterchenshen@...il.com>
Cc:     vyasevich@...il.com, nhorman@...driver.com, davem@...emloft.net,
        linux-sctp@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sctp: delete addr based on sin6_scope_id

Hi,

The fix is right, but a couple of small changes:

On Sun, Jul 25, 2021 at 08:43:39PM +0800, Chen Shen wrote:
> sctp_inet6addr_event deletes 'addr' from 'local_addr_list' when setting
> netdev down, but it has possibility to delete the incorroct entry (match
                                                          ^ typo

> the first one with the same ipaddr, but the different 'ifindex'), if
> there are some netdevs with the same 'local-link' ipaddr added already.
> It should delete the entry depending on 'sin6_addr' and 'sin6_scope_id'
> both, otherwise, the endpoint will call 'sctp_sf_ootb' if it can't find
> the accroding association when receives 'heartbeat', and finally will
         ^^ typo

> reply 'abort' which causes the test case for NOKIA SYSCOM GW failed.
> 
...
> diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
> index 52c92b8d827f..66ebf1e3383d 100644
> --- a/net/sctp/ipv6.c
> +++ b/net/sctp/ipv6.c
> @@ -100,7 +100,9 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
>  					&net->sctp.local_addr_list, list) {
>  			if (addr->a.sa.sa_family == AF_INET6 &&
>  					ipv6_addr_equal(&addr->a.v6.sin6_addr,
> -						&ifa->addr)) {
> +						&ifa->addr) &&
> +					addr->a.v6.sin6_scope_id ==
> +						ifa->idev->dev->ifindex) {

The indentation here is not right. It was wrong already, but lets
seize the moment and fix it. This is how it should look like:

 			if (addr->a.sa.sa_family == AF_INET6 &&
 			    ipv6_addr_equal(&addr->a.v6.sin6_addr,
					    &ifa->addr) &&
			    addr->a.v6.sin6_scope_id ==	ifa->idev->dev->ifindex) {

Thanks,
Marcelo

>  				sctp_addr_wq_mgmt(net, addr, SCTP_ADDR_DEL);
>  				found = 1;
>  				addr->valid = 0;
> -- 
> 2.19.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ