Kernel: Don't preserve set-uid bit in open() and bind() modes

For some reason we were keeping the bits 04777 in file modes. That
doesn't seem right and I can't think of a reason why the set-uid bit
should be allowed to slip through.
This commit is contained in:
Andreas Kling 2021-01-23 15:35:20 +01:00
commit c32176db27
Notes: sideshowbarker 2024-07-18 22:55:48 +09:00
2 changed files with 3 additions and 3 deletions

View file

@ -57,7 +57,7 @@ int Process::sys$open(Userspace<const Syscall::SC_open_params*> user_params)
REQUIRE_PROMISE(cpath);
// Ignore everything except permission bits.
mode &= 04777;
mode &= 0777;
auto path = get_syscall_path_argument(params.path);
if (path.is_error())