auth: filesystem unlink action check + add parent vnode to auth_filesystem_check

This commit is contained in:
Matheus
2024-08-27 21:46:33 -03:00
parent 284d91f6e7
commit ba6506b9d7
9 changed files with 55 additions and 22 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ static int dochmod(vnode_t *node, mode_t mode) {
vattr_t attr;
cred_t *cred = &_cpu()->thread->proc->cred;
int e = auth_filesystem_check(cred, AUTH_ACTIONS_FILESYSTEM_SETATTR, node);
int e = auth_filesystem_check(cred, AUTH_ACTIONS_FILESYSTEM_SETATTR, node, NULL);
if (e)
return e;
+1 -1
View File
@@ -50,7 +50,7 @@ syscallret_t syscall_fchownat(context_t *, int fd, char *upath, uid_t owner, gid
goto cleanup;
}
ret.errno = auth_filesystem_check(&_cpu()->thread->proc->cred, AUTH_ACTIONS_FILESYSTEM_SETATTR, node);
ret.errno = auth_filesystem_check(&_cpu()->thread->proc->cred, AUTH_ACTIONS_FILESYSTEM_SETATTR, node, NULL);
if (ret.errno) {
VOP_UNLOCK(node);
goto cleanup;
+1 -1
View File
@@ -71,7 +71,7 @@ syscallret_t syscall_utimensat(context_t *, int fd, char *upath, timespec_t uts[
attr.atime = ts[0];
attr.mtime = ts[1];
ret.errno = auth_filesystem_check(&_cpu()->thread->proc->cred, AUTH_ACTIONS_FILESYSTEM_SETATTR, node);
ret.errno = auth_filesystem_check(&_cpu()->thread->proc->cred, AUTH_ACTIONS_FILESYSTEM_SETATTR, node, NULL);
if (ret.errno) {
if (uts == NULL)
ret.errno = VOP_ACCESS(node, V_ACCESS_WRITE, &_cpu()->thread->proc->cred);