aboutsummaryrefslogtreecommitdiff
path: root/tests/crypt/(developers-only)
diff options
context:
space:
mode:
authorR. Christian McDonald <rcm@FreeBSD.org>2026-10-08 23:08:19 +0000
committerR. Christian McDonald <rcm@FreeBSD.org>2026-10-08 23:08:19 +0000
commitec76d3f600b528df7c29d3305e44342f08789fbf (patch)
tree20517fdf7b3f31e423ef9e27e75622f2c8af41f2 /tests/crypt/(developers-only)
parentc01c0a27cb82ca40ed507889c8f78fb2dcf76568 (diff)
nd6: Do not allocate an ifaddr for the interface ID in in6_ifadd()HEADmain
Without a suitable link-local address, in6_ifadd() obtains the interface identifier from in6_get_ifid(). It wrote the result into a freshly allocated struct in6_ifaddr, M_NOWAIT since the function runs in the network epoch, so SLAAC could fail under memory pressure over a 16 byte scratch buffer. Write the identifier into the on-stack address the rest of the function uses instead. Zero it first, in6_get_ifid() only fills in the low 64 bits, as the M_ZERO allocation did. Track which path provided the identifier with a flag instead of a pointer into the ifaddr, so each path releases its own reference. Reviewed by: glebius Fixes: 9e792f7ef729 ("sys/netinet6: Fix SLAAC for interfaces with no /64 LL address") Fixes: f9fc93690aef ("sys/netinet6: fix memory corruption in in6_ifadd") MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D60488
Diffstat (limited to 'tests/crypt/(developers-only)')
0 files changed, 0 insertions, 0 deletions