summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-06 23:39:39 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-07 01:18:02 +0200
commite226400dd8a7780d407184581d4398c5c65412f9 (patch)
tree9afecae80b98c9ccb242b9693495f9040cf55628
parentf4624e4ee18702e0e2f81cd31d68dd22740f1cfb (diff)
downloadserenity-e226400dd8a7780d407184581d4398c5c65412f9.zip
Kernel: Don't seek the program executable description in sys$execve()
The dynamic loader doesn't care if the kernel has moved the file cursor around before it gains control.
-rw-r--r--Kernel/Syscalls/execve.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp
index 8e0cb1d03b..263163feff 100644
--- a/Kernel/Syscalls/execve.cpp
+++ b/Kernel/Syscalls/execve.cpp
@@ -527,8 +527,6 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description
});
if (main_program_fd_allocation.has_value()) {
- auto seek_result = main_program_description->seek(0, SEEK_SET);
- VERIFY(!seek_result.is_error());
main_program_description->set_readable(true);
m_fds[main_program_fd_allocation->fd].set(move(main_program_description), FD_CLOEXEC);
}