]> git.ipfire.org Git - thirdparty/strongswan.git/commit
child-sa: Handle refcount overflow for unique mark/if_id allocation gracefully
authorMartin Willi <martin@strongswan.org>
Fri, 16 Feb 2024 09:59:11 +0000 (10:59 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 16 Feb 2024 13:04:17 +0000 (14:04 +0100)
commit1a740bf3f3e20c8a7ff88ca9dcf043fb051670a7
tree617084896ed422b181726fb57a525c753ecc78c5
parentdde40bcb9eedcb8b3d42c49aa29f98833ba3f720
child-sa: Handle refcount overflow for unique mark/if_id allocation gracefully

The refcount_t for allocating unique marks and interface IDs may overflow or
hit the special value for unique marks/if_ids, in the worst case not setting it
on CHILD_SAs that should have one.

As (potentially two) marks/if_ids are allocated only for newly created CHILD_SAs,
but not for rekeying, this not very likely. Still, if a setup uses
aggressive re-authentication and or re-creates CHILD_SAs every minute,
a gateway with 100'000 tunnels may hit the overflow within a month uptime.
src/libstrongswan/ipsec/ipsec_types.c