⬢ DragonFlyBSD Kernel Audit
DF-5684 / fix.diff
← back to finding ↓ download raw
--- a/sys/kern/vfs_quota.c
+++ b/sys/kern/vfs_quota.c
@@ -42,6 +42,7 @@
 #include <sys/spinlock2.h>
 
 #include <sys/sysmsg.h>
+#include <sys/caps.h>
 #include <libprop/proplib.h>
 #include <libprop/prop_dictionary.h>
 
@@ -341,6 +342,9 @@
 
 	if (!vfs_quota_enabled)
 		return EOPNOTSUPP;
+	error = caps_priv_check_td(curthread, SYSCAP_NOQUOTA_WR);
+	if (error)
+		return (error);
 	path = vqa->path;
 	error = copyin(vqa->pref, &pref, sizeof(pref));
 	error = prop_dictionary_copyin(&pref, &dict);