Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2403474lqp; Sun, 24 Mar 2024 18:04:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXSe31O+fkmenmRA23di7CT4bFgybuq1Kc78c3JvGE5mAOViI8nS/qQzX72CGITo2vEoTpnUQ6dgOQXKN7/8ISny47proni5y4nzWuJyg== X-Google-Smtp-Source: AGHT+IFh2UlBVse8xdaRScVGVa5vZ5wgJFu0hqQmcUp43ZZMFMxRxCKSyrVSgOknJhhdTJye1n8z X-Received: by 2002:a17:906:7817:b0:a47:35df:3d40 with SMTP id u23-20020a170906781700b00a4735df3d40mr4527507ejm.4.1711328676422; Sun, 24 Mar 2024 18:04:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711328676; cv=pass; d=google.com; s=arc-20160816; b=BBMJGIk6UYL/ULJWEfbQyApQeAR2hEMzF8cP34TsWvT7vh6/MNB0/PM6yFvsza+ghr 7coy+txaQzkA7tGLnTgr6wTu/eBOCod/9Y9EjV3oWNy6Ww5+Bk+L8N2RCICBZEsJnQxP g6mFQqixHq8gJzLVCX2l4tmAaG0YyBMDUfUGBOO84SVAU9UssSP5G649DJmWo2VlN1nj bFmkfhXolf5jB76pxqUKoebzoCBgY9BDl2stDN+Y+g80wW73VUNKnIkA6C73M8LOFUtC qKUimHNgx3ORLM1YOYJnL2rbU1KizvBQzguoEux8X655sUuwN4nKgtPJKWbzuSTU7Z/4 fWAw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=iNLEbGGYGPjXLCmxvWxGB9rThEVYnAkspoRc4BfI0H4=; fh=jmUZ4xB2JdYcixYrX/T4zZyUMXPJTks5m4a5WlHvZCc=; b=s1BydDrGsblaPqZsBo99fPMNM5lJ8lR39cG9wPetykE8u8tDPwp8hxRFK9em5XiU0S NXkyqKYTNmaBUBxIb0be2DywBrKAlOJQ72+PrINWuOMpk1JOY49591uEMkyiE1Bc2zv1 vz2keOd6uRYoNAzVrvn8c57tHLYkxN6at8ITNIq3QCIjw5s6E4pteGo8HYltTOJNhI77 FeRap0JMe4OLGAd8y/3exp1LuWEWI0hlbuxyMjIE52XldQoOOJASh8qClM4+t5ASAULF EOr8Pwt9keJ3dlqoHq8ChqAPo/jzZcmWcQovNKEktHNrG24sYOT/fn5LoXkqChaWYKtT Ygqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WFP7QoiG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113563-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q23-20020a1709060f9700b00a46fbbc2f56si2030239ejj.460.2024.03.24.18.04.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 18:04:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WFP7QoiG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113563-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 2AECC1F236C9 for ; Mon, 25 Mar 2024 01:04:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A8421C6ACB; Sun, 24 Mar 2024 22:46:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WFP7QoiG" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CA4A13E6DA; Sun, 24 Mar 2024 22:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320365; cv=none; b=IGcLvPbqWOrH7LuhfhzX6KZxozF03yrIvxZ0N/6sGTeJX8sg0DEtphkxrDqk8DCyWqpRRZ4CdRmxHyf1GqoKZ4wmIG41TCtzMwOyMPeOLQh6sl83a1XoPlEsiIYOzZ+EDp08lS+/LI1RZdMZVEMw140wgvP2dsknYHIBoUyMNQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320365; c=relaxed/simple; bh=IPQUPry+ITtcAdi3zYmL9JlqymXhYmP6surBfz44xq4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b2yzdBxXWqcUEUYt85N8Fu0o3/PVFMsib7lLqf6nYWSCVd8XMmd5+XzKkuv/OEmVNS6RYnrs2aPGwgz3n6HileTINzOPpnpn1LLGvkA3ZfbZ5cm3JCL4SKFgk3LunS8bouXkEPcmOsdtVu66feTCM1UktTgBYKXfaFYrZ9z1Y8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WFP7QoiG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5172C43394; Sun, 24 Mar 2024 22:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320365; bh=IPQUPry+ITtcAdi3zYmL9JlqymXhYmP6surBfz44xq4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WFP7QoiGcr51KOwOPNZZAUv0+pzkc5a7M3DA//+WXmLmdJUe/3TcBX9kHL/95kX/t U2oCft87PkPm74/0fNL1yy0u3RlytrybrDt0abx9e4OnV0tXOeL7DD49+eIGQRIT1f 5xINV5T8+QE97rwUPWYjtBRVHitPqWm90kQpX8ufkCm//ls97aiHEE87zNfO6DMsEc hqAo4V6TRwJ7+MeXiQ+dtrfweQxYut0rn7MWsNg0Iilbfh/9touvKh5lMUeVV4omMA 4TrKMPtDfbb2WXBIOHUtf4kj1BfLXG/P+o4UXEvv54FV4npI71VuPFxk7Gf3aAnj4+ NiuL5H3fn3vdQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Leon Romanovsky , Paolo Abeni , Steffen Klassert , Sasha Levin Subject: [PATCH 6.8 672/715] xfrm: Allow UDP encapsulation only in offload modes Date: Sun, 24 Mar 2024 18:34:11 -0400 Message-ID: <20240324223455.1342824-673-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Leon Romanovsky [ Upstream commit 773bb766ca4a05bf363203030b72b10088869224 ] The missing check of x->encap caused to the situation where GSO packets were created with UDP encapsulation. As a solution return the encap check for non-offloaded SA. Fixes: 983a73da1f99 ("xfrm: Pass UDP encapsulation in TX packet offload") Closes: https://lore.kernel.org/all/a650221ae500f0c7cf496c61c96c1b103dcb6f67.camel@redhat.com Reported-by: Paolo Abeni Signed-off-by: Leon Romanovsky Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin --- net/xfrm/xfrm_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c index 653e51ae39648..6346690d5c699 100644 --- a/net/xfrm/xfrm_device.c +++ b/net/xfrm/xfrm_device.c @@ -407,7 +407,8 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x) struct xfrm_dst *xdst = (struct xfrm_dst *)dst; struct net_device *dev = x->xso.dev; - if (!x->type_offload) + if (!x->type_offload || + (x->xso.type == XFRM_DEV_OFFLOAD_UNSPECIFIED && x->encap)) return false; if (x->xso.type == XFRM_DEV_OFFLOAD_PACKET || -- 2.43.0