mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +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
Notes:
sideshowbarker
2024-07-19 01:18:01 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/086522537ec
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…
Reference in a new issue