mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:08:12 +00:00
Kernel: No need to use safe_memcpy() when handling an inode fault
We're copying the inode contents from a stack buffer into a page that we just quick-mapped, so there's no reason for this memcpy() to fail.
This commit is contained in:
parent
8264511d32
commit
13a2e91fc5
1 changed files with 1 additions and 12 deletions
|
@ -562,18 +562,7 @@ PageFaultResponse Region::handle_inode_fault(size_t page_index_in_region)
|
|||
}
|
||||
|
||||
u8* dest_ptr = MM.quickmap_page(*vmobject_physical_page_entry);
|
||||
{
|
||||
void* fault_at;
|
||||
if (!safe_memcpy(dest_ptr, page_buffer, PAGE_SIZE, fault_at)) {
|
||||
if ((u8*)fault_at >= dest_ptr && (u8*)fault_at <= dest_ptr + PAGE_SIZE)
|
||||
dbgln(" >> inode fault: error copying data to {}/{}, failed at {}",
|
||||
vmobject_physical_page_entry->paddr(),
|
||||
VirtualAddress(dest_ptr),
|
||||
VirtualAddress(fault_at));
|
||||
else
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
memcpy(dest_ptr, page_buffer, PAGE_SIZE);
|
||||
MM.unquickmap_page();
|
||||
|
||||
remap_vmobject_page(page_index_in_vmobject);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue