mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:07:34 +00:00
Kernel: Change method name to clarify physical memory mmap validation
This commit is contained in:
parent
f9c4f65e1f
commit
876559d283
3 changed files with 3 additions and 3 deletions
|
@ -46,7 +46,7 @@ ErrorOr<Memory::Region*> MemoryDevice::mmap(Process& process, OpenFileDescriptio
|
|||
auto viewed_address = PhysicalAddress(offset);
|
||||
|
||||
dbgln("MemoryDevice: Trying to mmap physical memory at {} for range of {} bytes", viewed_address, range.size());
|
||||
if (!MM.is_allowed_to_mmap_to_userspace(viewed_address, range)) {
|
||||
if (!MM.is_allowed_to_mmap_physical_memory_to_userspace(viewed_address, range)) {
|
||||
dbgln("MemoryDevice: Trying to mmap physical memory at {} for range of {} bytes failed due to violation of access", viewed_address, range.size());
|
||||
return EINVAL;
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ UNMAP_AFTER_INIT void MemoryManager::register_reserved_ranges()
|
|||
m_reserved_memory_ranges.append(ContiguousReservedMemoryRange { range.start, m_physical_memory_ranges.last().start.get() + m_physical_memory_ranges.last().length - range.start.get() });
|
||||
}
|
||||
|
||||
bool MemoryManager::is_allowed_to_mmap_to_userspace(PhysicalAddress start_address, VirtualRange const& range) const
|
||||
bool MemoryManager::is_allowed_to_mmap_physical_memory_to_userspace(PhysicalAddress start_address, VirtualRange const& range) const
|
||||
{
|
||||
// Note: Guard against overflow in case someone tries to mmap on the edge of
|
||||
// the RAM
|
||||
|
|
|
@ -230,7 +230,7 @@ public:
|
|||
PageDirectory& kernel_page_directory() { return *m_kernel_page_directory; }
|
||||
|
||||
Vector<UsedMemoryRange> const& used_memory_ranges() { return m_used_memory_ranges; }
|
||||
bool is_allowed_to_mmap_to_userspace(PhysicalAddress, VirtualRange const&) const;
|
||||
bool is_allowed_to_mmap_physical_memory_to_userspace(PhysicalAddress, VirtualRange const&) const;
|
||||
|
||||
PhysicalPageEntry& get_physical_page_entry(PhysicalAddress);
|
||||
PhysicalAddress get_physical_address(PhysicalPage const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue