diff options
| author | Steffen Klassert <steffen.klassert@secunet.com> | 2026-10-20 07:41:14 +0200 |
|---|---|---|
| committer | Steffen Klassert <steffen.klassert@secunet.com> | 2026-10-20 07:41:14 +0200 |
| commit | 835912998ca54a76b5c57f8c8459a86b1b45de40 (patch) | |
| tree | ddf6334b015d9e8304b3b2c1b5d68414c4b21401 /include/uapi/linux/errqueue.h | |
| parent | f9a11716c8445b496e9fafeec7e8412d384d02e2 (diff) | |
| parent | dcf413245c8c2351f7f80502f89c344256f61a66 (diff) | |
Merge branch 'xfrm: state: exact mark/mask match for control-plane SA lookups'
Antony Antony says:
====================
While looking into a XFRM_MSG_MIGRATE_STATE issue reported by Sashiko,
we found the underlying problem generalizes: xfrm allows multiple SAs
to coexist for the same (SPI, daddr, proto) differing only in mark,
and every netlink method that resolves "which SA" - xfrm get_sa(),
del_sa(), update, get_ae, new_ae, expire, migrate - uses the same
wildcard mark match the data path needs. A broader-mask SA can
silently shadow a more specific one:
# ip xfrm state add ... spi 0x1000 mark 1 mask 1 (SA_target)
# ip xfrm state add ... spi 0x1000 mark 0 mask 0
(SA_decoy, catch-all, added after -> bucket head)
# ip xfrm state delete dst ... proto esp spi 0x1000 mark 1 mask 1
-> deletes SA_decoy; SA_target survives, untouched
xfrm policy had the same bug, fixed in commit 4f47e8ab6ab7
("xfrm: policy: match with both mark and mask on user interfaces").
Netlink state lookups using spi use an exact mark/mask match except
for UPDSA; the wildcard match stays for the data path and state_add only.
This series applies that fix across every affected method,
not just XFRM_MSG_MIGRATE_STATE.
Also reject marks with value bits outside the mask (state ADD,
ALLOCSPI, policy ADD, MIGRATE_STATE new mark). These are
misconfigurations anyway, since the extra bits can never match, and
break exact match added here.
This series does not touch PF_KEY, which no longer receives
non-critical fixes.
state_lookup_byaddr is out of scope. This is only fixing spi based
lookups.
====================
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'include/uapi/linux/errqueue.h')
0 files changed, 0 insertions, 0 deletions
