summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs/procfs_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/procfs/procfs_ioctl.c')
-rw-r--r--sys/fs/procfs/procfs_ioctl.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/fs/procfs/procfs_ioctl.c b/sys/fs/procfs/procfs_ioctl.c
index 3808a2b..04fe603 100644
--- a/sys/fs/procfs/procfs_ioctl.c
+++ b/sys/fs/procfs/procfs_ioctl.c
@@ -34,6 +34,7 @@
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/pioctl.h>
+#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/systm.h>
@@ -104,8 +105,19 @@ procfs_ioctl(PFS_IOCTL_ARGS)
#endif
case PIOCSFL:
flags = *(unsigned int *)data;
- if (flags & PF_ISUGID && (error = suser(td)) != 0)
- break;
+ if (flags & PF_ISUGID) {
+ /*
+ * XXXRW: Is this specific check required here, as
+ * p_candebug() should implement it, or other checks
+ * are missing.
+ *
+ * XXXRW: Other debugging privileges are granted in
+ * jail, why isn't this?
+ */
+ error = priv_check(td, PRIV_DEBUG_SUGID);
+ if (error)
+ break;
+ }
p->p_pfsflags = flags;
break;
case PIOCGFL:
OpenPOWER on IntegriCloud