Date: Wed, 20 Mar 2002 23:08:48 -0500 From: "Alexander N. Kabaev" <ak03@gte.com> To: current@FreeBSD.org Cc: rwatson@FreeBSD.org, arr@FreeBSD.org Subject: securelevel_gt used incorrectly in kldload? Message-ID: <20020321040848.GA72774@kanpc.gte.com>
next in thread | raw e-mail | index | archive | help
The following check added into kern_linker.c seems wrong somehow:
if (securelevel_gt(td->td_ucred, 0) == 0) {
error = EPERM;
goto out;
}
The last thing securelevel_gt does is to perform this check:
return (active_securelevel > level ? EPERM : 0);
i.e. it returns EPERM is securelevel restriction is violated.
Should above construct be rewritten as follows instead?
if ((error = securelevel_gt(td->td_ucred, 0)) != 0)
goto out;
The same bug is present in vfs_mount too.
--
Alexander Kabaev
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020321040848.GA72774>
