mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 09:15:07 +00:00
UserspaceEmulator: Mark mmap and shbuf regions as initialized up front
A lot of software relies on the fact that mmap and shbuf memory is zeroed out by the kernel, so we should consider it initialized from the shadow bit perspective as well.
This commit is contained in:
parent
903c5b0833
commit
2a2e76c802
2 changed files with 6 additions and 2 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "MmapRegion.h"
|
||||
#include "Emulator.h"
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
namespace UserspaceEmulator {
|
||||
|
@ -51,7 +52,8 @@ MmapRegion::MmapRegion(u32 base, u32 size, int prot)
|
|||
: Region(base, size)
|
||||
, m_prot(prot)
|
||||
{
|
||||
m_shadow_data = (u8*)calloc(1, size);
|
||||
m_shadow_data = (u8*)malloc(size);
|
||||
memset(m_shadow_data, 1, size);
|
||||
}
|
||||
|
||||
MmapRegion::~MmapRegion()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue