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, 27 Nov 2020 16:06:50 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Florian Westphal <fw@...len.de>
Cc:     Antoine Tenart <atenart@...nel.org>, pablo@...filter.org,
        kadlec@...filter.org, roopa@...dia.com, nikolay@...dia.com,
        netdev@...r.kernel.org, netfilter-devel@...r.kernel.org,
        coreteam@...filter.org, sbrivio@...hat.com
Subject: Re: [PATCH net-next] netfilter: bridge: reset skb->pkt_type after
 NF_INET_POST_ROUTING traversal

On Mon, 23 Nov 2020 19:32:53 +0100 Florian Westphal wrote:
> Antoine Tenart <atenart@...nel.org> wrote:
> > Netfilter changes PACKET_OTHERHOST to PACKET_HOST before invoking the
> > hooks as, while it's an expected value for a bridge, routing expects
> > PACKET_HOST. The change is undone later on after hook traversal. This
> > can be seen with pairs of functions updating skb>pkt_type and then
> > reverting it to its original value:
> > 
> > For hook NF_INET_PRE_ROUTING:
> >   setup_pre_routing / br_nf_pre_routing_finish
> > 
> > For hook NF_INET_FORWARD:
> >   br_nf_forward_ip / br_nf_forward_finish
> > 
> > But the third case where netfilter does this, for hook
> > NF_INET_POST_ROUTING, the packet type is changed in br_nf_post_routing
> > but never reverted. A comment says:
> > 
> >   /* We assume any code from br_dev_queue_push_xmit onwards doesn't care
> >    * about the value of skb->pkt_type. */  
> 
> [..]
> > But when having a tunnel (say vxlan) attached to a bridge we have the
> > following call trace:  
> 
> > In this specific case, this creates issues such as when an ICMPv6 PTB
> > should be sent back. When CONFIG_BRIDGE_NETFILTER is enabled, the PTB
> > isn't sent (as skb_tunnel_check_pmtu checks if pkt_type is PACKET_HOST
> > and returns early).
> > 
> > If the comment is right and no one cares about the value of
> > skb->pkt_type after br_dev_queue_push_xmit (which isn't true), resetting
> > it to its original value should be safe.  
> 
> That comment is 18 years old, safe bet noone thought of
> ipv6-in-tunnel-interface-added-as-bridge-port back then.
> 
> Reviewed-by: Florian Westphal <fw@...len.de>

Sounds like a fix. Probably hard to pin point which commit to blame,
but this should go to net, not net-next, right?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ