]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfrm: Clear low order bits of ->flowi4_tos in decode_session4().
authorGuillaume Nault <gnault@redhat.com>
Wed, 3 Jan 2024 15:06:32 +0000 (16:06 +0100)
committerSasha Levin <sashal@kernel.org>
Fri, 15 Mar 2024 14:48:14 +0000 (10:48 -0400)
commit4aa935c02a8beaeb79f87ad7fe3385c1ac493892
treecd6780812996fc9eb98d30e15c66ff7b1cfa334a
parent56e70ceb2f957ea59541cd8b82b736541b8f8896
xfrm: Clear low order bits of ->flowi4_tos in decode_session4().

[ 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 <gnault@redhat.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/xfrm/xfrm_policy.c