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:   Fri, 24 Jul 2020 16:21:34 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Guillaume Nault <gnault@...hat.com>
Cc:     David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
        Martin Varghese <martin.varghese@...ia.com>,
        Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net] bareudp: forbid mixing IP and MPLS in multiproto
 mode

On Fri, 24 Jul 2020 23:03:26 +0200 Guillaume Nault wrote:
> In multiproto mode, bareudp_xmit() accepts sending multicast MPLS and
> IPv6 packets regardless of the bareudp ethertype. In practice, this
> let an IP tunnel send multicast MPLS packets, or an MPLS tunnel send
> IPv6 packets.
> 
> We need to restrict the test further, so that the multiproto mode only
> enables
>   * IPv6 for IPv4 tunnels,
>   * or multicast MPLS for unicast MPLS tunnels.
> 
> To improve clarity, the protocol validation is moved to its own
> function, where each logical test has its own condition.
> 
> Fixes: 4b5f67232d95 ("net: Special handling for IP & MPLS.")
> Signed-off-by: Guillaume Nault <gnault@...hat.com>

Hi! this adds 10 sparse warnings:

drivers/net/bareudp.c:419:22: warning: cast to restricted __be16
drivers/net/bareudp.c:419:22: warning: cast to restricted __be16
drivers/net/bareudp.c:419:22: warning: cast to restricted __be16
drivers/net/bareudp.c:419:22: warning: cast to restricted __be16
drivers/net/bareudp.c:419:13: warning: restricted __be16 degrades to integer
drivers/net/bareudp.c:423:22: warning: cast to restricted __be16
drivers/net/bareudp.c:423:22: warning: cast to restricted __be16
drivers/net/bareudp.c:423:22: warning: cast to restricted __be16
drivers/net/bareudp.c:423:22: warning: cast to restricted __be16

I think this:

	    proto == ntohs(ETH_P_MPLS_MC))

has to say htons() not ntohs(). For v6 as well.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ