summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorPaul Chaignon <paul.chaignon@gmail.com>2025-05-07 14:31:58 +0300
committerSteffen Klassert <steffen.klassert@secunet.com>2025-05-14 08:18:58 +0300
commit0b91fda3a1f044141e1e615456ff62508c32b202 (patch)
tree336937cf7d7aff531c59d9105bd71cba56c42f30 /tools/perf/scripts/python
parent417fae2c40896f0a67ce7fa7d9b8c6056ec36dd9 (diff)
downloadlinux-0b91fda3a1f044141e1e615456ff62508c32b202.tar.xz
xfrm: Sanitize marks before insert
Prior to this patch, the mark is sanitized (applying the state's mask to the state's value) only on inserts when checking if a conflicting XFRM state or policy exists. We discovered in Cilium that this same sanitization does not occur in the hot-path __xfrm_state_lookup. In the hot-path, the sk_buff's mark is simply compared to the state's value: if ((mark & x->mark.m) != x->mark.v) continue; Therefore, users can define unsanitized marks (ex. 0xf42/0xf00) which will never match any packet. This commit updates __xfrm_state_insert and xfrm_policy_insert to store the sanitized marks, thus removing this footgun. This has the side effect of changing the ip output, as the returned mark will have the mask applied to it when printed. Fixes: 3d6acfa7641f ("xfrm: SA lookups with mark") Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com> Signed-off-by: Louis DeLosSantos <louis.delos.devel@gmail.com> Co-developed-by: Louis DeLosSantos <louis.delos.devel@gmail.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions