summaryrefslogtreecommitdiff
path: root/Kernel/Process.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-17 10:18:25 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-17 10:18:25 +0100
commitcf8dd312abcc31d5cd61b80c93775c169a2233b5 (patch)
tree7d7207f545a22d48ef6ef2ecb3215270f08b1359 /Kernel/Process.h
parent4b15dd2bcac74f973bc068ac68986ec513e63731 (diff)
downloadserenity-cf8dd312abcc31d5cd61b80c93775c169a2233b5.zip
Kernel: Fix String leaks in exec().
When the kernel performs a successful exec(), whatever was on the kernel stack for that process before goes away. For this reason, we need to make sure we don't have any stack objects holding onto kmalloc memory.
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r--Kernel/Process.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h
index bbad42d35e..b44fda0dce 100644
--- a/Kernel/Process.h
+++ b/Kernel/Process.h
@@ -279,7 +279,7 @@ public:
size_t amount_shared() const;
Process* fork(RegisterDump&);
- int exec(const String& path, Vector<String>&& arguments, Vector<String>&& environment);
+ int exec(String path, Vector<String> arguments, Vector<String> environment);
bool is_root() const { return m_euid == 0; }
@@ -302,7 +302,7 @@ private:
Process(String&& name, uid_t, gid_t, pid_t ppid, RingLevel, RetainPtr<Inode>&& cwd = nullptr, RetainPtr<Inode>&& executable = nullptr, TTY* = nullptr, Process* fork_parent = nullptr);
- int do_exec(const String& path, Vector<String>&& arguments, Vector<String>&& environment);
+ int do_exec(String path, Vector<String> arguments, Vector<String> environment);
void push_value_on_stack(dword);
int alloc_fd();