HomeFreeBSD

clnt_broadcast(3): don't free function pointers

Description

clnt_broadcast(3): don't free function pointers

Replace use of thr_getspecific/thr_setspecific to stash the function
pointer we're smuggling between clnt_broadcast and rpc_wrap_bcast with a
simple thread local variable. Clear it after use so the reference
doesn't linger.

In the relatively unlikely event clnt_broadcast was called from threads
that exited prior to program termination, the previous code called free
on a function pointer, which is undefined and might corrupted allocator
state.

Effort: CHERI upstreaming
Reviewed by: glebius, jhb
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D54939

Details

Provenance
brooksAuthored on Feb 2 2026, 9:20 PM
Reviewer
glebius
Differential Revision
D54939: clnt_broadcast(3): don't free function pointers
Parents
rGdafba19e42e7: MFV less v691
Branches
Unknown
Tags
Unknown