Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1353786lqa; Mon, 29 Apr 2024 06:25:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUoL9ITlp4vvZb84XsGK6xroC9jAj23caj7QG8I2+n++buPPm8+mPsRMgcc43NVv4AYfYQIW+UjphAuGmQOpTRbDwCJqsvL5zAsfJv5FQ== X-Google-Smtp-Source: AGHT+IFJVMxgQGSa2bmmmXurMKUYeNIkUX9aIPJtwKOgxGm44NGvgRiHS+EvcnZgaWUljnrpuhmc X-Received: by 2002:a17:906:56cf:b0:a55:67ae:bbe3 with SMTP id an15-20020a17090656cf00b00a5567aebbe3mr6128083ejc.44.1714397142017; Mon, 29 Apr 2024 06:25:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714397142; cv=pass; d=google.com; s=arc-20160816; b=XLH7gdv8ZwokuQmK5axSZXhhHu2reE7QlUlngVUWjBF4PibZOlRJe2Yp84s5Ngxc2T zOxIJGg+4QmyLUdbQfdB6rI7ptu9c6jCqDKgkk48I8GNQGlg8Vts2bP2QYzI8lACmHQU Jut8oTZ8Fu9m/lGXdeXAhK8HMvAPxETxvevCjjzfnSxA+KwOVeffY9HrT8obOu3ObNZl k1FkT6YEIhAyLHeBnrkpiMvF/FM0LxvwgEqXIJwJbyQiACEUvLv4i9qc/kdP3G7F47Nu 2o64ulFlU87/k5m146x325a0kx0tSPeEZLMaJoNw3Inz9EvKVhwzaY/aefDcETno/VdU 90mA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:references:in-reply-to :message-id:cc:to:from:date:dkim-signature; bh=1cRqB/pgj2GzUQ8QqpEYAm3EnSOnu+i1KftcUkQHuOo=; fh=P2M3wNscutNryPtg+y2/E5TNjAb7u40MzSt0x44zExY=; b=KUC9YDXTB2/keDbEMSI9EMz74DXZa9G2Gd6RDtLV3/zklYQbVEEmc0gJukkEAJzfjK IxZvm+1OZR9F3RyAnlcR6JAK78amm1Z58cDvrDA3RWBtDw2y7Esg8rKFBEUNEGksQ+cV zlk26kYPlxELbef6QyPbijFGEZgdLUqYrBxC8xciJo4dOrrd+sEaw+NQsW7OulXJI1GE +U1FtxZevkk8iOoJStDZlmFMltodAdkkvvePJFrwavM+HKj/YWM509vwMdIdL/lfeTKl HfZPGh+rux0woLEXt4AN9skr8ghPbbwE3jDZvtrndTU/9wDISC4wngW3HUqiAHp4JfUc ByiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iwR95npn; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-162363-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162363-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d23-20020a17090648d700b00a589a275f02si6106671ejt.860.2024.04.29.06.25.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 06:25:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162363-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iwR95npn; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-162363-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162363-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BABBC1F25096 for ; Mon, 29 Apr 2024 13:25:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 626BE6E5EF; Mon, 29 Apr 2024 13:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iwR95npn" Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33D5D42055; Mon, 29 Apr 2024 13:25:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714397133; cv=none; b=q4vL3R/pa0e0L3TX6s0i2f3BXAOC+pzookvZ9dwqub6EbBkQF9FDPkPrerv1RS8gmiNnoQjnjFmOk52SeD++L/jUwDVaX25YoD6eELXYF0WBKFW58wteKBJ03vbshOBQIhyBe5n/aGYW54BIKALyUS5uKy8UtuRcM5DATaFKqD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714397133; c=relaxed/simple; bh=OkGqsz24HaQ8U2SLy0X0H8hrrM/zi1dkI/vFgwhn/uQ=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: Mime-Version:Content-Type; b=gyIxuStPRn8rtoQhwLT9uqKE9DN5rbSdgTmghsODoGWdGYRRTU/aE8/gvA0SVQDUNNDaJL2O4H/ug+3eqrxrKYAjKFshJ0ww1mnfqHxZXclAfxbEZCnAq1khoRQ8i3+Txe1qLOtR7AlfZdHPulruJm/Fiat6AwNuafD8oWpRXt4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iwR95npn; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-790fb2b780dso55842285a.0; Mon, 29 Apr 2024 06:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714397130; x=1715001930; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=1cRqB/pgj2GzUQ8QqpEYAm3EnSOnu+i1KftcUkQHuOo=; b=iwR95npnDYmpwzLAl04pqLIlzIzGY/St+actfwN1a0fBtKHZ/oq5D1tBhxM0xH2381 NniEltmADqe82W4+rTxD+CtWD07HGNJUFm2b5Wv4U+w1/zp4gHUCG+y37TungxyjdiCy G0Wx6Dj07szgivNi1JpX16tMFHyRAzhoNqj8usq9ybouOAJfU1Aff8q2OgiW9GKA7qj3 xHBxJnySP3+lnoCg1ra0cy6HTA9u1vRrENECtXWwrfjHzlDFtLa5Vxed3B6DQupu2hET NiNql8LLvb6ILD+aXx1cpBF9BKvsUwpR7ZExKBKIwrB6/LF10eQ1s5wQW/y0Qp260WEx glPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714397130; x=1715001930; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=1cRqB/pgj2GzUQ8QqpEYAm3EnSOnu+i1KftcUkQHuOo=; b=uiE41OdtNrLI6gkF2uKCgvkEctRCWevw4maDVE1M2nvDbWjOJj5sFWk9Bp7bNlosBA vY9+ibL2yKnSpAwOCfMKCf2yBNAEuRTeY57hXm8MOHW6AuaYMNBrEbq0Tw7B02hhmJov E0B8AammkLfpVz6FnqCfxYwuUyJmHx4F2qbTxIiaE65EMU8K9sz/zHh/1D2+SEj0aZJs NZycpmyfG/oahuB4teFO73Rv1FduvWaCxOUVsP6oM3Tr/SROSUs+E8PR756gx5hpzrYz Py/NnXJ94REs0JNkqhbhfm/y8ZJiiF1dWY9cRB0lsoGI+bNu7KsG2ezu2yUboZrVC4dI Cwiw== X-Forwarded-Encrypted: i=1; AJvYcCVwSHjYTOLsHsWoDeeEvxbOXppqIJ+6owRRSaV6sZlj6dSTHp7+vpBggZmjP2LmbRygnWOrbtmhugBK4973CO1xh4JiF7VF X-Gm-Message-State: AOJu0YytWtgvQI5afhEOuF4oo7FGSBswtOsbq9yZeLbwAh8wp856j+Uc eZJy7HWILjYGTdrhQEiGu5TpaY8LmJoZZeDfNWSmz8Z/UtrahGx0 X-Received: by 2002:a05:620a:1a28:b0:790:f03a:243f with SMTP id bk40-20020a05620a1a2800b00790f03a243fmr4628229qkb.46.1714397130011; Mon, 29 Apr 2024 06:25:30 -0700 (PDT) Received: from localhost (164.146.150.34.bc.googleusercontent.com. [34.150.146.164]) by smtp.gmail.com with ESMTPSA id de28-20020a05620a371c00b0078d6b2b6fdbsm10352985qkb.133.2024.04.29.06.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 06:25:29 -0700 (PDT) Date: Mon, 29 Apr 2024 09:25:29 -0400 From: Willem de Bruijn To: shiming.cheng@mediatek.com, willemdebruijn.kernel@gmail.com, edumazet@google.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, matthias.bgg@gmail.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, shiming.cheng@mediatek.com, Lena Wang Message-ID: <662f9fc92a908_2e2f1d294c2@willemb.c.googlers.com.notmuch> In-Reply-To: <20240428143010.18719-1-shiming.cheng@mediatek.com> References: <20240428143010.18719-1-shiming.cheng@mediatek.com> Subject: Re: [PATCH net] net: drop pulled SKB_GSO_FRAGLIST skb Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit shiming.cheng@ wrote: > From: Shiming Cheng > > A SKB_GSO_FRAGLIST skb without GSO_BY_FRAGS is > expected to have all segments except the last > to be gso_size long. If this does not hold, the > skb has been modified and the fraglist gso integrity > is lost. Drop the packet, as it cannot be segmented > correctly by skb_segment_list. > > The skb could be salvaged. By linearizing, dropping > the SKB_GSO_FRAGLIST bit and entering the normal > skb_segment path rather than the skb_segment_list path. > > That choice is currently made in the protocol caller, > __udp_gso_segment. It's not trivial to add such a > backup path here. So let's add this backstop against > kernel crashes. > > Fixes: 3a1296a38d0c ("net: Support GRO/GSO fraglist chaining.") > Signed-off-by: Shiming Cheng > Signed-off-by: Lena Wang Reviewed-by: Willem de Bruijn