mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix exit_thread(2) passing unaligned sizes to UnmapMemory.
This commit is contained in:
parent
8eae7f359a
commit
472e31a9a1
1 changed files with 2 additions and 0 deletions
|
@ -351,6 +351,7 @@ int sys_exit_thread(int requested_exit_code,
|
|||
extended.unmap_size )
|
||||
{
|
||||
ScopedLock lock(&process->segment_lock);
|
||||
extended.unmap_size = Page::AlignDown(extended.unmap_size);
|
||||
Memory::UnmapMemory(process, (uintptr_t) extended.unmap_from,
|
||||
extended.unmap_size);
|
||||
Memory::Flush();
|
||||
|
@ -362,6 +363,7 @@ int sys_exit_thread(int requested_exit_code,
|
|||
extended.tls_unmap_size )
|
||||
{
|
||||
ScopedLock lock(&process->segment_lock);
|
||||
extended.tls_unmap_size = Page::AlignDown(extended.tls_unmap_size);
|
||||
Memory::UnmapMemory(process, (uintptr_t) extended.tls_unmap_from,
|
||||
extended.tls_unmap_size);
|
||||
Memory::Flush();
|
||||
|
|
Loading…
Reference in a new issue