Fix range check. The previous check would produce an off by one error making the
last byte of an unmapped-but-still-there page non-readable (i.e. from B_NO_LOCK areas), causing such reads to fail in KDL. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42276 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4839,8 +4839,8 @@ status_t
|
|||||||
vm_debug_copy_page_memory(team_id teamID, void* unsafeMemory, void* buffer,
|
vm_debug_copy_page_memory(team_id teamID, void* unsafeMemory, void* buffer,
|
||||||
size_t size, bool copyToUnsafe)
|
size_t size, bool copyToUnsafe)
|
||||||
{
|
{
|
||||||
if (size > B_PAGE_SIZE
|
if (size > B_PAGE_SIZE || ROUNDDOWN((addr_t)unsafeMemory, B_PAGE_SIZE)
|
||||||
|| ((addr_t)unsafeMemory + size) % B_PAGE_SIZE < size) {
|
!= ROUNDDOWN((addr_t)unsafeMemory + size - 1, B_PAGE_SIZE)) {
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user