kernel: validate PTE bits before mapping

git-svn-id: svn://kolibrios.org@5357 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2015-01-06 15:24:09 +00:00
parent b4814c7084
commit 82d7c79bd5

View File

@ -127,8 +127,8 @@ align 4
map_page:
push ebx
mov eax, [esp+12] ; phis_addr
and eax, not 0xFFF
or eax, [esp+16] ; flags
and eax, [pte_valid_mask]
mov ebx, [esp+8] ; lin_addr
shr ebx, 12
mov [page_tabs+ebx*4], eax
@ -191,8 +191,8 @@ proc map_io_mem stdcall, base:dword, size:dword, flags:dword
mov edx, [base]
shr eax, 12
shr ecx, 12
and edx, -4096
or edx, [flags]
and edx, [pte_valid_mask]
@@:
mov [page_tabs+eax*4], edx
invlpg [ebx]
@ -229,6 +229,7 @@ commit_pages:
pop ecx
pop eax
and eax, [pte_valid_mask ]
mov edi, ebx
shr edi, 12
lea edi, [page_tabs+edi*4]