mknodat: add auth check for device nodes

This commit is contained in:
Matheus
2026-05-13 18:24:33 -03:00
parent 38221a0d03
commit 5cfc6cf782
3 changed files with 16 additions and 0 deletions
+6
View File
@@ -337,6 +337,12 @@ int vfs_create(vnode_t *ref, char *path, vattr_t *attr, int type, vnode_t **node
goto cleanup_parent;
}
if (type == V_TYPE_CHDEV || type == V_TYPE_BLKDEV) {
err = auth_filesystem_check(getcred(), AUTH_ACTIONS_FILESYSTEM_MKNOD, parent, NULL);
if (err)
goto cleanup_parent;
}
vnode_t *ret;
err = VOP_CREATE(parent, component, attr, type, &ret, getcred());
if (err)