HomeFreeBSD

file: Make fget*() and getvnode*() consistent about initializing *fpp

Description

file: Make fget*() and getvnode*() consistent about initializing *fpp

Most fget*() functions initialize the output parameter to NULL. Make
the externally visible interface behave consistently, and make
fget_unlocked_seq() private to kern_descrip.c.

This fixes at least one bug in a consumer, _filemon_wrapper_openat(),
which assumes that getvnode() sets the output file pointer to NULL upon
an error.

Reported by: syzbot+01c0459408f896a5933a@syzkaller.appspotmail.com
Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 300cfb96fc2253c3aff8d501d5599fcf811daa34)

Details

Provenance
markjAuthored on Feb 8 2022, 5:34 PM
Parents
rGe32acf95ea25: cam_get_device: resolve path links before parsing device name
Branches
Unknown
Tags
Unknown