]> git.ipfire.org Git - thirdparty/strongswan.git/commit
child-sa: Handle CHILD_SA unique identifier refcount overflow gracefully
authorMartin Willi <martin@strongswan.org>
Wed, 10 Jan 2024 16:31:49 +0000 (17:31 +0100)
committerMartin Willi <martin@strongswan.org>
Fri, 16 Feb 2024 09:11:11 +0000 (10:11 +0100)
commit4aac88fadd7053ae15a4ff3e9039d979d8141211
tree0d9b4f93b7e873bc7caabda4b3c0fcd3cef348d3
parentf634a3300c9611b5ce4be945d6a606f5a0a1c5bb
child-sa: Handle CHILD_SA unique identifier refcount overflow gracefully

CHILD_SA unique identifier allocation starts at 1. If the counter overflows,
a unique ID of 0 is assigned to an CHILD_SA, which may have unclear
consequences.

Overflowing the unique ID counter is theoretical for most setups, but on
a Gateway terminating 100'000 tunnels and rekeying CHILD_SAs every 60s
overflows the counter after a month uptime. So avoid a 0 unique identifier
by using ref_get_nonzero().
src/libcharon/sa/child_sa.c