mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 11:17:43 +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);
|
u8* dest_ptr = MM.quickmap_page(*vmobject_physical_page_entry);
|
||||||
{
|
memcpy(dest_ptr, page_buffer, PAGE_SIZE);
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MM.unquickmap_page();
|
MM.unquickmap_page();
|
||||||
|
|
||||||
remap_vmobject_page(page_index_in_vmobject);
|
remap_vmobject_page(page_index_in_vmobject);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue