Skip to content

Commit fdd3ba8

Browse files
Andrew Boieandrewboie
authored andcommitted
x86: intel64: set the WP bit for paging
Otherwise, supervisor mode can write to read-only areas, failing tests that check this. Signed-off-by: Andrew Boie <[email protected]>
1 parent 4d4fb8e commit fdd3ba8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/core/intel64/locore.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ go64: movl %cr4, %eax /* enable PAE and SSE */
118118
wrmsr
119119

120120
movl %cr0, %eax /* enable paging */
121-
orl $CR0_PG, %eax
121+
orl $(CR0_PG | CR0_WP), %eax
122122
movl %eax, %cr0
123123

124124
jmpl $X86_KERNEL_CS, $1f

0 commit comments

Comments
 (0)