CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2026/09/24 22:55:43
Modified files:
sys/kern : subr_prof.c
Log message:
profil(2): release the dirfd reference, and publish pr_cdir once
Fixes both leaks reported by Acts1631, plus the race that fixing the
first one exposes.
- Take the vnode reference while the file reference is still held, then
FRELE() it.
- Acquire pr_ucred together with pr_cdir, after validation, so an
EBADF/ENOTDIR return cannot leave a cred held with pr_cdir still NULL
- Re-test pr_cdir before publishing to and release the loser's resource
deraadt@ Looks good