summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2001-10-23 19:11:31 +0000
committerRobert Watson <rwatson@FreeBSD.org>2001-10-23 19:11:31 +0000
commitb5c05ddcb8f7d0ebe86a4e7c4857f0a87d89666d (patch)
treea46c4ab936cbaed265bbce47add8c66fab5148da
parentfc2749a40cd0814c89ca4e647c6797aec307d453 (diff)
Notes
-rw-r--r--sys/nfsclient/nfs_lock.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/nfsclient/nfs_lock.c b/sys/nfsclient/nfs_lock.c
index ce047ba6ca8f..dfca164a4358 100644
--- a/sys/nfsclient/nfs_lock.c
+++ b/sys/nfsclient/nfs_lock.c
@@ -145,6 +145,10 @@ nfs_dolock(struct vop_advlock_args *ap)
* file error message for the user, otherwise the application will
* complain that the user's file is missing, which isn't the case.
* Note that we use proc0's cred, so the fifo is opened as root.
+ *
+ * XXX: Note that this behavior is relative to the root directory
+ * of the current process, and this may result in a variety of
+ * {functional, security} problems in chroot() environments.
*/
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, _PATH_LCKFIFO, td);
@@ -153,6 +157,9 @@ nfs_dolock(struct vop_advlock_args *ap)
* to open the fifo we need to write to. vn_open() really should
* take a ucred (and once it does, this code should be fixed to use
* proc0's ucred.
+ *
+ * XXX: This introduces an exploitable race condition allowing
+ * a local attacker to gain root privilege.
*/
saved_uid = p->p_ucred->cr_uid;
p->p_ucred->cr_uid = 0; /* temporarly run the vn_open as root */