diff mbox series

[1/5] xfrm: Clear low order bits of ->flowi4_tos in decode_session4().

Message ID 20240306100438.3953516-2-steffen.klassert@secunet.com (mailing list archive)
State Accepted
Commit 1982a2a02c9197436d4a8ea12f66bafab53f16a0
Delegated to: Netdev Maintainers
Headers show
Series [1/5] xfrm: Clear low order bits of ->flowi4_tos in decode_session4(). | expand

Checks

Context Check Description
netdev/series_format warning Pull request is its own cover letter; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 952 this patch: 952
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 2 blamed authors not CCed: fw@strlen.de horms@kernel.org; 4 maintainers not CCed: pabeni@redhat.com edumazet@google.com fw@strlen.de horms@kernel.org
netdev/build_clang success Errors and warnings before: 957 this patch: 957
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 968 this patch: 968
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-06--21-00 (tests: 892)

Commit Message

Steffen Klassert March 6, 2024, 10:04 a.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 7, 2024, 5 a.m. UTC | #1
Hello:

This series was applied to netdev/net.git (main)
by Steffen Klassert <steffen.klassert@secunet.com>:

On Wed, 6 Mar 2024 11:04:34 +0100 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [1/5] xfrm: Clear low order bits of ->flowi4_tos in decode_session4().
    https://git.kernel.org/netdev/net/c/1982a2a02c91
  - [2/5] xfrm: Pass UDP encapsulation in TX packet offload
    https://git.kernel.org/netdev/net/c/983a73da1f99
  - [3/5] xfrm: Avoid clang fortify warning in copy_to_user_tmpl()
    https://git.kernel.org/netdev/net/c/1a807e46aa93
  - [4/5] xfrm: fix xfrm child route lookup for packet offload
    https://git.kernel.org/netdev/net/c/d4872d70fc6f
  - [5/5] xfrm: set skb control buffer based on packet offload as well
    https://git.kernel.org/netdev/net/c/8688ab2170a5

You are awesome, thank you!
diff mbox series

Patch

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)