Most fget*() functions initialize the output parameter to NULL. Make them
all behave consistently. This fixes at least one bug in a consumer,
_filemon_wrapper_openat().
Reported by: syzbot+01c0459408f896a5933a@syzkaller.appspotmail.com
Paths
| Differential D34190 Authored by markj on Feb 7 2022, 3:19 PM.
Details Summary Most fget*() functions initialize the output parameter to NULL. Make them Reported by: syzbot+01c0459408f896a5933a@syzkaller.appspotmail.com
Diff Detail
Event TimelineHerald added a subscriber: imp. · View Herald TranscriptFeb 7 2022, 3:19 PM2022-02-07 15:19:32 (UTC+0) Harbormaster completed remote builds in B44319: Diff 102456.Feb 7 2022, 3:19 PM2022-02-07 15:19:32 (UTC+0)
This revision is now accepted and ready to land.Feb 7 2022, 3:39 PM2022-02-07 15:39:09 (UTC+0)
Comment Actions
This revision now requires review to proceed.Feb 7 2022, 5:43 PM2022-02-07 17:43:07 (UTC+0) Harbormaster completed remote builds in B44320: Diff 102458.Feb 7 2022, 5:43 PM2022-02-07 17:43:07 (UTC+0) markj retitled this revision from file: Make getvnode*() set the returned file handle to NULL upon error to file: Make fget*() and getvnode*() consistent about initializing *fpp.Feb 7 2022, 5:44 PM2022-02-07 17:44:32 (UTC+0) This revision is now accepted and ready to land.Feb 7 2022, 7:06 PM2022-02-07 19:06:34 (UTC+0) Closed by commit rG300cfb96fc22: file: Make fget*() and getvnode*() consistent about initializing *fpp (authored by markj). · Explain WhyFeb 8 2022, 6:37 PM2022-02-08 18:37:03 (UTC+0) This revision was automatically updated to reflect the committed changes. Comment Actions I see I'm late. Just a remark that this nullifying is pretty weird and thing to do instead is to set the pointer to a poisoned value when running with invariants, while patching all the consumers to not look at it if an error was returned. Maybe I'll get around to it.
Revision Contents
Diff 102458 sys/kern/kern_descrip.c
sys/kern/vfs_syscalls.c
sys/sys/filedesc.h
|
Could any of this stuff be moved inside make_dev_alias_p?