From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Steffen Klassert <steffen.klassert@secunet.com>,
<netdev@vger.kernel.org>
Subject: [PATCH 1/5] xfrm: Clear low order bits of ->flowi4_tos in decode_session4().
Date: Wed, 6 Mar 2024 11:04:34 +0100 [thread overview]
Message-ID: <20240306100438.3953516-2-steffen.klassert@secunet.com> (raw)
In-Reply-To: <20240306100438.3953516-1-steffen.klassert@secunet.com>
From: Guillaume Nault <gnault@redhat.com>
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 <gnault@redhat.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
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 1b7e75159727..7351f32052dc 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.34.1
next prev parent reply other threads:[~2024-03-06 10:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 10:04 [PATCH 0/5] pull request (net): ipsec 2024-03-06 Steffen Klassert
2024-03-06 10:04 ` Steffen Klassert [this message]
2024-03-07 5:00 ` [PATCH 1/5] xfrm: Clear low order bits of ->flowi4_tos in decode_session4() patchwork-bot+netdevbpf
2024-03-06 10:04 ` [PATCH 2/5] xfrm: Pass UDP encapsulation in TX packet offload Steffen Klassert
2024-03-11 16:25 ` Paolo Abeni
2024-03-11 17:05 ` Jakub Kicinski
2024-03-12 2:46 ` Jakub Kicinski
2024-03-12 6:20 ` Steffen Klassert
2024-03-12 11:15 ` Leon Romanovsky
2024-03-12 11:20 ` Steffen Klassert
2024-03-12 11:26 ` Leon Romanovsky
2024-03-12 11:36 ` Steffen Klassert
2024-03-06 10:04 ` [PATCH 3/5] xfrm: Avoid clang fortify warning in copy_to_user_tmpl() Steffen Klassert
2024-03-06 10:04 ` [PATCH 4/5] xfrm: fix xfrm child route lookup for packet offload Steffen Klassert
2024-03-06 10:04 ` [PATCH 5/5] xfrm: set skb control buffer based on packet offload as well Steffen Klassert
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=20240306100438.3953516-2-steffen.klassert@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).