Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp725062lqt; Fri, 19 Apr 2024 08:36:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLzf7IFbOfK4h35KZK7Uo0ELxa4AV6sTB8n8bNc5kP03vw6PcVUQCCaeB1WgfRm792AL6szXUAmEMJ4rZnND1Bpm/u17v2aoUQWjGzsQ== X-Google-Smtp-Source: AGHT+IG0KzF6t5K+6AyRaLBf5CDLLcIrqVSKmp9q/z5jUJeTjCccn2q1RrlAxabHO8eRFvhP7iXw X-Received: by 2002:a17:906:5856:b0:a55:5fb4:824f with SMTP id h22-20020a170906585600b00a555fb4824fmr2142126ejs.45.1713541014537; Fri, 19 Apr 2024 08:36:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713541014; cv=pass; d=google.com; s=arc-20160816; b=DdQHcAC7W53Qn3nxMaQTgwH2uulzLI2Jc6D2/8KQxfXWaPuUBpWL71fX+KaKAev9GC ViV+TCId31T4CqioBWEOVktglxQe8D6VrFFOjsFtCQSFld6AIsOg9yRsTbMlDp1FjRk7 9rQNYGaS0NzI6bphquMsUxmE29094MFqMzl8sdncU/+h+KBmba2THol9WUR4Yo9ETv3S AMhdYZbOUsRcmPnudRa71/VLjZXj0zhIPuAV63rDRixyU1Woivy4E6v8axngxr27RO+P 0m3xaOCf5rfC6VyWcQqxjXGz1BfaHWFvnRRbsjQxWVilzLiVqMDt4XKE0UZP2zfrqio3 UCWQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=ogeEX//bHF2HsqLQah7I8pSI5VIDZwGvgsrUulvUgJ8=; fh=EwW2UF6l1fRjrP7nrV/3cG3k4GEE6N5fl72pSW2tsSo=; b=DBS6ShBq6wxAr+pZQy4mlZQZ8Y+gbgSCmKJOOATarIOgxQ4blgquStFw2rBs49k6a5 d32zlbEz3aHfPv1KdIZuwsmYSlViyj/qksYHwhMZITyJJ+RvRb5PolFxe9gsei+5+SSJ jKkml+aFaBNMegi5r/sVpu0IbyUfuGWADvxyQ0tl5953da/U6sAKAdiTa4IuONeq93Bn lwqtmZ/GOYcS5rCcl+AVy5Cc4qKknCHXwCZsX6HdTLv93/glo7h7NiCPKeZfYKRCtsQE UWH/UzKJfd0dmerq4VyPiAjXrs5iL4sT8PvQ8hgdgZau8DVlRh4c/q4PuStBqzg3q8tY Aj8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bDUTCdso; 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-151684-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151684-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 ak6-20020a170906888600b00a5190b36f4fsi2303819ejc.634.2024.04.19.08.36.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:36:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151684-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=bDUTCdso; 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-151684-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151684-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 F1BC01F23ACF for ; Fri, 19 Apr 2024 15:36:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFC44130A46; Fri, 19 Apr 2024 15:36:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bDUTCdso" Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 987A312FF6A; Fri, 19 Apr 2024 15:36:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713540977; cv=none; b=SN2DRmYR5KQxgvkna+/rbEY8diJ6DTLr/PPtIx6f3M0CAmQDkB3B2QdGwmfv8e7HbLGgR2pzWd8OgJ/pHzYxDUTC4ub/9h6qTRAaQmmJ47pgoKzZl4YntbHpTvkMrLUa6h0Fgo0hv43eNhv63i7pOzDZ8z+lCGi7McnUtwwptKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713540977; c=relaxed/simple; bh=AnVpRpILY5Vd9N8iFqR8H3efTBFYjgWKXJUjsusHOgY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=XjNohiU+95YJMSvaa1yaYlCnATB/vlbELpdgiJkaJHQz7U5mHxxWsSbSlLvn+rcLr3fj6Zlkx49Y+ysOa538bcGvV9HxUprqZw3hLx+x3i+2bnQnTXjHkpi/aEVWUpNbE0m7RmnmyBve6FwTicf44bQchiyAdxJoORtQELvPlao= 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=bDUTCdso; arc=none smtp.client-ip=209.85.128.46 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-wm1-f46.google.com with SMTP id 5b1f17b1804b1-419c82338abso2909465e9.0; Fri, 19 Apr 2024 08:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713540974; x=1714145774; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ogeEX//bHF2HsqLQah7I8pSI5VIDZwGvgsrUulvUgJ8=; b=bDUTCdso4Ndo2faWzi8qemJ6aNywKGeAwtOqh+HfMXmNS0Sl3ShflCgoVFPhE4Eam7 +WSHt2ExadNpaVfczOa+iPseg69aeE9ak6KenlO3oMzwd/BqmuWKRlH33hpHHoxEtcIb 8RAMNElyWwT3udm17xbfw/PEsMQLxUF3Pyzs0RqbB5rqJhaN4d7JXqnDB5jcVRe2Wklv LuwiAoyzV0gM4adgmIjtJT1N0MidYdgkAc5OX2IBWVLP7II3eU6/slkigm6J8HnTockY VK71UZhUHxqYtRcU+S1GAdLhacCb3Esv4zQ8//PYwiN+hewS9YO3TfMms0rbhSh36s4t 0lYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713540974; x=1714145774; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ogeEX//bHF2HsqLQah7I8pSI5VIDZwGvgsrUulvUgJ8=; b=kMvoKk9Cm4Uydn8mZr2jSpB8TQYa5SFCYg6skOzqnCYsxsJ6ZlCnu/W1ExLdK1aKJj wbWDcGJTOcoW5u/TppJ+t0+JqGF0+fhCzT+I6CFFxtzhI1z+UxdfymcOec1gDqpVu/zI pXnjoDMl/9wJ6xksU9RyfaUAi1hNc6ammQkoTTJSgQgNg8vWhmjrxgpBUEt3Ke2v7SAD yqffjbHcFjZ5k2GvIMIEb8Ugc8S13YA0oplvlfR1COxH7h97cDhliUTq0lRsk421yzf2 WB6XzypwDRVfgpoVWYS93DnHSMVLUBJB/zTE7o1hH1bmUF/82yVryATGUG4EMOdiF9ee M9dg== X-Forwarded-Encrypted: i=1; AJvYcCXLW7CFlkSDbKq8Idl8XHrDXgHgXcpoY9irAdwLyX2k4GCQq1hJej6by/s/aW+N5ANtHh03XQPst8NoMk71wr8CYnCLxPJdjl7stz3YWnM0yLNTWUqMGB48GiPaydjWJMHTbkQ4 X-Gm-Message-State: AOJu0YyvUF6mmoqGpAzZTbplg823CSPnUfTkbXb8ug5rrR6IMzD+YiOA Bs/UQ5NAxnjECj0CfCE05RjMyjkfdNtx7DDDtwnLdosQ2gu3Z5WM X-Received: by 2002:a05:600c:138c:b0:418:829e:efa5 with SMTP id u12-20020a05600c138c00b00418829eefa5mr2232752wmf.20.1713540973786; Fri, 19 Apr 2024 08:36:13 -0700 (PDT) Received: from localhost ([146.70.204.204]) by smtp.gmail.com with ESMTPSA id v15-20020adfa1cf000000b0034a81bc5675sm451033wrv.96.2024.04.19.08.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:36:13 -0700 (PDT) From: Richard Gobert To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, dsahern@kernel.org, willemdebruijn.kernel@gmail.com, alexander.duyck@gmail.com, aleksander.lobakin@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Richard Gobert Subject: [PATCH net v2 0/3] net: gro: add flush/flush_id checks and fix wrong offset in udp Date: Fri, 19 Apr 2024 17:35:39 +0200 Message-Id: <20240419153542.121087-1-richardbgobert@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series fixes a bug in the complete phase of UDP in GRO, in which socket lookup fails due to using network_header when parsing encapsulated packets. The fix is to add network_offset and inner_network_offset to napi_gro_cb and use these offsets for socket lookup. In addition p->flush/flush_id should be checked in all UDP flows. The same logic from tcp_gro_receive is applied for all the flows in udp_gro_receive_segment. This prevents packets with mismatching network headers (flush/flush_id turned on) from merging in UDP GRO. The original series includes a change to vxlan test which adds the local parameter to prevent similar future bugs. I plan to submit it separately to net-next. This series is part of a previously submitted series to net-next: https://lore.kernel.org/all/20240408141720.98832-1-richardbgobert@gmail.com/ v1 -> v2: - Use network_offsets instead of p_poff param as suggested by Willem - Check flush before postpull, and for all UDP GRO flows (previously reviewed by Willem, and was changed since) - v1: https://lore.kernel.org/netdev/20240412152120.115067-1-richardbgobert@gmail.com/ Richard Gobert (3): net: gro: add {inner_}network_offset to napi_gro_cb net: gro: fix udp bad offset in socket lookup net: gro: add flush check in udp_gro_receive_segment drivers/net/geneve.c | 1 + drivers/net/vxlan/vxlan_core.c | 1 + include/net/gro.h | 18 ++++++++++++++++-- net/8021q/vlan_core.c | 2 ++ net/core/gro.c | 1 + net/ethernet/eth.c | 1 + net/ipv4/af_inet.c | 5 +---- net/ipv4/gre_offload.c | 1 + net/ipv4/udp.c | 3 ++- net/ipv4/udp_offload.c | 15 +++++++++++++-- net/ipv6/ip6_offload.c | 8 ++++---- net/ipv6/udp.c | 3 ++- net/ipv6/udp_offload.c | 3 ++- 13 files changed, 47 insertions(+), 15 deletions(-) -- 2.36.1