HomeFreeBSD

fdesc_allocvp(): fix potential use after free

Description

fdesc_allocvp(): fix potential use after free

Just owning the interlock is not enough for vget() to operate on the
vnode race-free with vgone(), the vnode should be held. Use
vget_prep()/vget_finish() to avoid vholding the vnode explicitly, and
drop LK_INTERLOCK.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D39207

Details

Provenance
kibAuthored on Mar 21 2023, 9:24 PM
Reviewer
markj
Differential Revision
D39207: Some fdescfs fixes
Parents
rGfa3ea81b77e4: fdescfs: remove useless XXX comment, unwrap line
Branches
Unknown
Tags
Unknown