mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
Kernel: Don't leak ref on executable inode in sys$execve()
We were leaking a ref on the executed inode in successful calls to sys$execve(). This meant that once a binary had ever been executed, it was impossible to remove it from the file system. The execve system call is particularly finicky since the function does not return normally on success, so extra care must be taken to ensure nothing is kept alive by stack variables. There is a big NOTE comment about this, and yet the bug still got in. It would be nice to enforce this, but I'm unsure how.
This commit is contained in:
parent
bb9c705fc2
commit
086522537e
1 changed files with 1 additions and 1 deletions
|
@ -486,7 +486,7 @@ int Process::exec(String path, Vector<String> arguments, Vector<String> environm
|
|||
auto result = VFS::the().open(path, O_EXEC, 0, current_directory());
|
||||
if (result.is_error())
|
||||
return result.error();
|
||||
auto description = result.value();
|
||||
auto description = result.release_value();
|
||||
auto metadata = description->metadata();
|
||||
|
||||
// Always gonna need at least 3 bytes. these are for #!X
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue