From: Takuya Yoshikawa Date: Wed, 30 Jan 2013 10:40:41 +0000 (+0900) Subject: KVM: set_memory_region: Disallow changing read-only attribute later X-Git-Tag: v3.9-rc1~97^2~7^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75d61fbcf563373696578570e914f555e12c8d97;p=pandora-kernel.git KVM: set_memory_region: Disallow changing read-only attribute later As Xiao pointed out, there are a few problems with it: - kvm_arch_commit_memory_region() write protects the memory slot only for GET_DIRTY_LOG when modifying the flags. - FNAME(sync_page) uses the old spte value to set a new one without checking KVM_MEM_READONLY flag. Since we flush all shadow pages when creating a new slot, the simplest fix is to disallow such problematic flag changes: this is safe because no one is doing such things. Reviewed-by: Gleb Natapov Signed-off-by: Takuya Yoshikawa Cc: Xiao Guangrong Cc: Alex Williamson Signed-off-by: Marcelo Tosatti --- Reading git-diff-tree failed