]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
file: Make fget*() and getvnode*() consistent about initializing *fpp
authorMark Johnston <markj@FreeBSD.org>
Tue, 8 Feb 2022 17:34:20 +0000 (12:34 -0500)
committerMark Johnston <markj@FreeBSD.org>
Tue, 8 Feb 2022 17:40:41 +0000 (12:40 -0500)
commit300cfb96fc2253c3aff8d501d5599fcf811daa34
treea65b0f02d8c3a92e7a5d57cdc75c34bd80e9480c
parent927aa5fefd4c69e72d44189a04fadf80e42d0ad8
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
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34190
sys/kern/kern_descrip.c
sys/kern/vfs_syscalls.c
sys/sys/filedesc.h