HomeFreeBSD

icmp6: fix use-after-reference-release

Description

icmp6: fix use-after-reference-release

We release the reference to the in6_ifaddr but retain a pointer to it.
Copy the address itself, rather than keeping the pointer to fix this.

The previous version was actually safe, because ifa_free() uses an epoch
callback to free it, so the pointer would have remained valid as long as we are
in net_epoch.
Change it to copying the address anyway because it is more obviously correct and
will remain correct even if ifa_free() changes later.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D50460

Details

Provenance
kpAuthored on May 22 2025, 8:25 AM
Differential Revision
D50460: icmp6: fix use-after-reference-release
Parents
rGd67f1132f018: Revert commit e89d737041d1 (config.5: Document CONF_CFLAGS under 'makeoptions').
Branches
Unknown
Tags
Unknown