VFS: Always open kernel FDs with O_CLOEXEC.
* Avoids leaking them into userland.
This commit is contained in:
@@ -8143,7 +8143,7 @@ _kern_open(int fd, const char* path, int openMode, int perms)
|
||||
if (openMode & O_CREAT)
|
||||
return file_create(fd, pathBuffer.LockBuffer(), openMode, perms, true);
|
||||
|
||||
return file_open(fd, pathBuffer.LockBuffer(), openMode, true);
|
||||
return file_open(fd, pathBuffer.LockBuffer(), openMode | O_CLOEXEC, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user