mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: stable@vger.kernel.org, willemdebruijn.kernel@gmail.com,
	mst@redhat.com, jasowang@redhat.com, edumazet@google.com,
	virtualization@lists.linux-foundation.org, davem@davemloft.net,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	willemb@google.com, syzkaller@googlegroups.com,
	liuhangbin@gmail.com, linux-kernel@vger.kernel.org,
	joneslee@google.com
Subject: Re: [PATCH 0/2] net/af_packet: Fix kernel BUG in __skb_gso_segment
Date: Wed, 4 Jan 2023 13:43:43 +0100	[thread overview]
Message-ID: <Y7V0f77yhwYplQQz@kroah.com> (raw)
In-Reply-To: <20221222083545.1972489-1-tudor.ambarus@linaro.org>

On Thu, Dec 22, 2022 at 10:35:43AM +0200, Tudor Ambarus wrote:
> The series is intended for stable@vger.kernel.org # 5.4+
> 
> Syzkaller reported the following bug on linux-5.{4, 10, 15}.y:
> https://syzkaller.appspot.com/bug?id=ce5575575f074c33ff80d104f5baee26f22e95f5
> 
> The upstream commit that introduces this bug is:
> 1ed1d5921139 ("net: skip virtio_net_hdr_set_proto if protocol already set")
> 
> Upstream fixes the bug with the following commits, one of which introduces
> new support:
> e9d3f80935b6 ("net/af_packet: make sure to pull mac header")
> dfed913e8b55 ("net/af_packet: add VLAN support for AF_PACKET SOCK_RAW GSO") 
> 
> The additional logic and risk backported seems manageable.
> 
> The blammed commit introduces a kernel BUG in __skb_gso_segment for
> AF_PACKET SOCK_RAW GSO VLAN tagged packets. What happens is that
> virtio_net_hdr_set_proto() exists early as skb->protocol is already set to
> ETH_P_ALL. Then in packet_parse_headers() skb->protocol is set to
> ETH_P_8021AD, but neither the network header position is adjusted, nor the
> mac header is pulled. Thus when we get to validate the xmit skb and enter
> skb_mac_gso_segment(), skb->mac_len has value 14, but vlan_depth gets
> updated to 18 after skb_network_protocol() is called. This causes the
> BUG_ON from __skb_pull(skb, vlan_depth) to be hit, as the mac header has
> not been pulled yet.
> 
> The fixes from upstream backported cleanly without conflicts. I updated
> the commit message of the first patch to describe the problem encountered,
> and added Cc, Fixes, Reported-by and Tested-by tags. For the second patch
> I just added Cc to stable indicating the versions to be fixed, and added
> my Tested and Signed-off-by tags.
> 
> I tested the patches on linux-5.{4, 10, 15}.y.
> 
> Eric Dumazet (1):
>   net/af_packet: make sure to pull mac header
> 
> Hangbin Liu (1):
>   net/af_packet: add VLAN support for AF_PACKET SOCK_RAW GSO
> 
>  net/packet/af_packet.c | 20 +++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)

Now queued up, thanks.

greg k-h

      parent reply	other threads:[~2023-01-04 12:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22  8:35 Tudor Ambarus
2022-12-22  8:35 ` [PATCH 1/2] net/af_packet: add VLAN support for AF_PACKET SOCK_RAW GSO Tudor Ambarus
2022-12-22  8:35 ` [PATCH 2/2] net/af_packet: make sure to pull mac header Tudor Ambarus
2023-01-04 12:43 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y7V0f77yhwYplQQz@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jasowang@redhat.com \
    --cc=joneslee@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=syzkaller@googlegroups.com \
    --cc=tudor.ambarus@linaro.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=willemb@google.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®