mirror of
https://github.com/torvalds/linux.git
synced 2026-12-01 19:12:36 +00:00
KVM may turn a user page to a kernel page when kernel writes a readonly user page if CR0.WP = 1. This shadow page entry will be reused after SMAP is enabled so that kernel is allowed to access this user page Fix it by setting SMAP && !CR0.WP into shadow page's role and reset mmu once CR4.SMAP is updated Signed-off-by: Xiao Guangrong <[email protected]> Cc: [email protected] Signed-off-by: Paolo Bonzini <[email protected]>