@@ -984,6 +984,24 @@ void test_read_of_access_disabled_region(int *ptr, u16 pkey)
984
984
dprintf1 ("*ptr: %d\n" , ptr_contents );
985
985
expected_pkey_fault (pkey );
986
986
}
987
+
988
+ void test_read_of_access_disabled_region_with_page_already_mapped (int * ptr ,
989
+ u16 pkey )
990
+ {
991
+ int ptr_contents ;
992
+
993
+ dprintf1 ("disabling access to PKEY[%02d], doing read @ %p\n" ,
994
+ pkey , ptr );
995
+ ptr_contents = read_ptr (ptr );
996
+ dprintf1 ("reading ptr before disabling the read : %d\n" ,
997
+ ptr_contents );
998
+ read_pkey_reg ();
999
+ pkey_access_deny (pkey );
1000
+ ptr_contents = read_ptr (ptr );
1001
+ dprintf1 ("*ptr: %d\n" , ptr_contents );
1002
+ expected_pkey_fault (pkey );
1003
+ }
1004
+
987
1005
void test_write_of_write_disabled_region (int * ptr , u16 pkey )
988
1006
{
989
1007
dprintf1 ("disabling write access to PKEY[%02d], doing write\n" , pkey );
@@ -1390,6 +1408,7 @@ void test_mprotect_pkey_on_unsupported_cpu(int *ptr, u16 pkey)
1390
1408
void (* pkey_tests [])(int * ptr , u16 pkey ) = {
1391
1409
test_read_of_write_disabled_region ,
1392
1410
test_read_of_access_disabled_region ,
1411
+ test_read_of_access_disabled_region_with_page_already_mapped ,
1393
1412
test_write_of_write_disabled_region ,
1394
1413
test_write_of_access_disabled_region ,
1395
1414
test_kernel_write_of_access_disabled_region ,
0 commit comments