File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 33
33
* bit 2 == 0: kernel-mode access 1: user-mode access
34
34
* bit 3 == 1: use of reserved bit detected
35
35
* bit 4 == 1: fault was an instruction fetch
36
+ * bit 5 == 1: protection keys block access
36
37
*/
37
38
enum x86_pf_error_code {
38
39
@@ -41,6 +42,7 @@ enum x86_pf_error_code {
41
42
PF_USER = 1 << 2 ,
42
43
PF_RSVD = 1 << 3 ,
43
44
PF_INSTR = 1 << 4 ,
45
+ PF_PK = 1 << 5 ,
44
46
};
45
47
46
48
/*
@@ -916,6 +918,12 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte)
916
918
917
919
if ((error_code & PF_INSTR ) && !pte_exec (* pte ))
918
920
return 0 ;
921
+ /*
922
+ * Note: We do not do lazy flushing on protection key
923
+ * changes, so no spurious fault will ever set PF_PK.
924
+ */
925
+ if ((error_code & PF_PK ))
926
+ return 1 ;
919
927
920
928
return 1 ;
921
929
}
You can’t perform that action at this time.
0 commit comments