We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9e9a64 commit fc2fbc8Copy full SHA for fc2fbc8
arch/x86/include/asm/pgtable.h
@@ -1119,7 +1119,14 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
1119
*/
1120
static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count)
1121
{
1122
- memcpy(dst, src, count * sizeof(pgd_t));
+ memcpy(dst, src, count * sizeof(pgd_t));
1123
+#ifdef CONFIG_PAGE_TABLE_ISOLATION
1124
+ if (!static_cpu_has(X86_FEATURE_PTI))
1125
+ return;
1126
+ /* Clone the user space pgd as well */
1127
+ memcpy(kernel_to_user_pgdp(dst), kernel_to_user_pgdp(src),
1128
+ count * sizeof(pgd_t));
1129
+#endif
1130
}
1131
1132
#define PTE_SHIFT ilog2(PTRS_PER_PTE)
0 commit comments