Kernel: Only load program headers of interpreter if its present

I was loading program headers of both executable and interpreter but
that is incorrect. The interpreter will itself load the program headers
of the executable.
This commit is contained in:
2024-08-28 21:19:37 +03:00
parent 50ab391133
commit 8da2f12ba6
3 changed files with 205 additions and 244 deletions

View File

@@ -519,8 +519,8 @@ namespace Kernel
{
VirtualFileSystem::File file;
TRY(file.canonical_path.append("<self>"));
file.inode = m_loadable_elf->inode();
m_userspace_info.file_fd = TRY(m_open_file_descriptors.open(BAN::move(file), O_EXEC));
file.inode = m_loadable_elf->executable();
m_userspace_info.file_fd = TRY(m_open_file_descriptors.open(BAN::move(file), O_RDONLY));
}
for (size_t i = 0; i < sizeof(m_signal_handlers) / sizeof(*m_signal_handlers); i++)