vfs: Return early from sysctl_vfs_ctl() if no input was given

Otherwise we end up searching for a mountpoint using an uninitialized
key, and likely failing the version test.  This violates KMSAN's
invariants, so simply return immediately instead.

MFC after:	2 weeks
This commit is contained in:
Mark Johnston 2025-03-20 01:34:18 +00:00
parent 48d6b52add
commit d8703cd802

View file

@ -6519,6 +6519,8 @@ sysctl_vfs_ctl(SYSCTL_HANDLER_ARGS)
int error;
struct mount *mp;
if (req->newptr == NULL)
return (EINVAL);
error = SYSCTL_IN(req, &vc, sizeof(vc));
if (error)
return (error);