From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH v3 net,stable] tun: fix vlan packet truncation Date: Wed, 18 Apr 2018 13:52:57 -0400 (EDT) Message-ID: <20180418.135257.362879449353986102.davem@davemloft.net> References: <20180417204638.11800-1-bjorn@mork.no> Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Cc: netdev@vger.kernel.org, jasowang@redhat.com To: bjorn@mork.no Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:46138 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751232AbeDRRw7 (ORCPT ); Wed, 18 Apr 2018 13:52:59 -0400 In-Reply-To: <20180417204638.11800-1-bjorn@mork.no> Sender: netdev-owner@vger.kernel.org List-ID: From: Bjørn Mork Date: Tue, 17 Apr 2018 22:46:38 +0200 > Bogus trimming in tun_net_xmit() causes truncated vlan packets. > > skb->len is correct whether or not skb_vlan_tag_present() is true. There > is no more reason to adjust the skb length on xmit in this driver than > any other driver. tun_put_user() adds 4 bytes to the total for tagged > packets because it transmits the tag inline to userspace. This is > similar to a nic transmitting the tag inline on the wire. > > Reproducing the bug by sending any tagged packet through back-to-back > connected tap interfaces: ... > Fixes: aff3d70a07ff ("tun: allow to attach ebpf socket filter") > Cc: Jason Wang > Signed-off-by: Bjørn Mork Applied and queued up for -stable, thanks.