Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1847875lql; Wed, 13 Mar 2024 09:43:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXnGhI/7HnD2mqk07J5aPz4QHBLyJAL500fVpCklnaYZA5ON3/QZLCbZcy5G4TLIpWwtqbwNl5GP52rs+ktwhN1g/+4ajIyJxq5S5Ax3w== X-Google-Smtp-Source: AGHT+IHfaelUqXl/vDP72qY9t0vIJXFuKwfbzHq44edPguke4iW8TLz8hKN/F5Rw83L5II8QuaUl X-Received: by 2002:a05:6a20:9386:b0:1a3:3399:dd2a with SMTP id x6-20020a056a20938600b001a33399dd2amr2193207pzh.18.1710348194985; Wed, 13 Mar 2024 09:43:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710348194; cv=pass; d=google.com; s=arc-20160816; b=fEarl/H0O3XCvyXuk3N2CNS9B1XCkxeKSdMFz4aj0C+kpwz+rwJEgCBfRPFI/ZJ7pm 3UTSipahE5AZ3EUF5Milwyui+BWFz6AGyzJz1OMWDPNC2upwJscdCHsy39L8DU/Vs0T/ uVjSHJTKQIzcoEV9Tzz+BFxZSzUU3fEZLNXwdk5BW11YSTEdvLO5/mxXNj/X87K6t44h 4AFqsMlJ7gP1lyjFRvrBFnyW871lnoXpiKq/i+mkXbzGdugi5RY6LYnagFFtda+z6Max s8BTgzjJsGn7REBbEYhZOSfmyf5kEPs2l4sx12Yo+H9uQf5hskZt9tlUKMQ6P+Hk102x d7sA== 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=xS1ovEad9KxHxbtMH+YGjecCwSTwQuugznemjYLwdDs=; fh=bMKruyS6bI4JZAnlPrXdVemtdZsQdbFwWj9DawZGZ1E=; b=b+Z7leBaSMBUWeK/DlMu0CZ6otUfQajF9I3HCcgykGJeZyO5Om0gGQjgANpaFxoI1Z 8gUAonOqTK3UW/4ajK3hqcXm3Q2gql0MTqi0g3hha+e8HQ0WV3DOI2VO9d6ZRfb3h1Ym vwIoWWfJseLRIDrChr/toEPzj5/1PYrqOetdccDmp5BrKXA74S4wI+/n5YezVHYbsptJ HfRXIuA8U1YFTG8CHu5yS2tIB/C05VEtRUhGvq7YnaJtT8muCvTYKC80ixahP+L8Sam5 EU1LLQ1Sq86h9Pr3aDwYwxbxBYctDGt9XfLqus7KggTAG4JDcYmJJ++v8m9gt8bDBqoE gI9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dLuuTpmq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id o37-20020a635a25000000b005bd27be66e1si4534407pgb.719.2024.03.13.09.43.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:43:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dLuuTpmq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101747-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 546C6289116 for ; Wed, 13 Mar 2024 16:34:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95DB258119; Wed, 13 Mar 2024 16:32:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dLuuTpmq" 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 B93EA56B7F; Wed, 13 Mar 2024 16:32:48 +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=1710347568; cv=none; b=dCILSCHHC4yqRn4HmIrlJifbz9l90xHQ97swsrQrwJzwkg06fKDw1SBivmeFtoJs3NIPBwI2iN7xGhLW/52I3QA5x7MTn8D7HCSd7hibS+1e8Q9bwxYtiEr6FM7ybQ+nktu2sGkQLXhnrrZF2T9Jf1KDosgEixYoEPJOqo1GwGU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347568; c=relaxed/simple; bh=7S7HCJW9mvbBTxHyz3ldQDTtoUXg6JT0YPDvWToakec=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k+FZ6GfvK6fq/UBqLdRGqFykFFRgoe8LU5Svonp8uJhYwuxaldunvwgNq5KSl4QYhdCajVDQdIJaSAlvND1uT2dNjTDGyzEF0yx1u3uti9vgU6wmW9VIpEb8ug7+7q5VOlwim2H7v3xNk5xTPgMxo4cImwdpiph1WvEMT0kiaaY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dLuuTpmq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAA1DC433F1; Wed, 13 Mar 2024 16:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347568; bh=7S7HCJW9mvbBTxHyz3ldQDTtoUXg6JT0YPDvWToakec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dLuuTpmqaNfwVBZ7xKyfYx9CtVriA/dzBwonN1Oh6j5+6tbmbMZmRgGGiLDL1mJ2m 8sKEw9B34a6b2EVL3kSb0YnqkObPYSVrp34DPjNdqrgtFBLtSEQYQAjk7R3iv2PtOK fnfSf9cxITd0j08bCUpEkI+nMHEmGg2Eo6mECnf2ttYat7QJ/AcjB9tbxQNboSY1GK ceWkLywkeCPdOByEbRBLmUqv6Zu7doKwWKBuP1kv7oKTlGK+uHWIqw+t5pSatw8ytv DOzNZnA8hyEAiA7Wx3KrAWcTO3zs/YBRHrlL9c+qq2fqcJfYOnUs1Wk9V43qlBiDHm UHr/RzamSM5/w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Guillaume Nault , Steffen Klassert , Sasha Levin Subject: [PATCH 6.7 08/61] xfrm: Clear low order bits of ->flowi4_tos in decode_session4(). Date: Wed, 13 Mar 2024 12:31:43 -0400 Message-ID: <20240313163236.613880-9-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163236.613880-1-sashal@kernel.org> References: <20240313163236.613880-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-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.7.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.7.10-rc1 X-KernelTest-Deadline: 2024-03-15T16:32+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Guillaume Nault [ Upstream commit 1982a2a02c9197436d4a8ea12f66bafab53f16a0 ] Commit 23e7b1bfed61 ("xfrm: Don't accidentally set RTO_ONLINK in decode_session4()") fixed a problem where decode_session4() could erroneously set the RTO_ONLINK flag for IPv4 route lookups. This problem was reintroduced when decode_session4() was modified to use the flow dissector. Fix this by clearing again the two low order bits of ->flowi4_tos. Found by code inspection, compile tested only. Fixes: 7a0207094f1b ("xfrm: policy: replace session decode with flow dissector") Signed-off-by: Guillaume Nault Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin --- net/xfrm/xfrm_policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index c13dc3ef79107..e69d588caa0c6 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -3416,7 +3416,7 @@ decode_session4(const struct xfrm_flow_keys *flkeys, struct flowi *fl, bool reve } fl4->flowi4_proto = flkeys->basic.ip_proto; - fl4->flowi4_tos = flkeys->ip.tos; + fl4->flowi4_tos = flkeys->ip.tos & ~INET_ECN_MASK; } #if IS_ENABLED(CONFIG_IPV6) -- 2.43.0