+1
−2
Loading
hygon inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBGDLQ CVE: NA --------------------------- Assume the userspace request CSV3's KVM ioctl interface on Hygon CPUs before C86-4G, the vm_size if as value sizeof(struct kvm_svm), and functions for the CSV3's KVM ioctl interface try to check whether the guest is a CSV3 guest by access the structure as below: struct kvm_csv_info { ...... bool csv3_active; ...... }; struct kvm_svm_csv { struct kvm_svm kvm_svm; struct kvm_csv_info csv_info; }; But the csv_info field of struct kvm_svm_csv will not be allocated, the functions for the CSV3's KVM ioctl interface will not get value of csv3_active field of struct kvm_csv_info. Always fix the vm_size in csv_init() to address the above issue. Fixes: a87600ec ("KVM: SVM: CSV: Add KVM_CSV3_INIT command") Fixes: e23a88d6 ("KVM: SVM: CSV: Add KVM_CSV3_LAUNCH_ENCRYPT_DATA command") Fixes: 3f0c982b ("KVM: SVM: CSV: Add KVM_CSV3_LAUNCH_ENCRYPT_VMCB command") Fixes: 9080aa62 ("KVM: SVM: CSV: Manage CSV3 guest's nested page table") Fixes: ef841260 ("KVM: SVM: CSV: Add KVM_CSV3_SEND_ENCRYPT_DATA command") Fixes: fca88def ("KVM: SVM: CSV: Add KVM_CSV3_SEND_ENCRYPT_CONTEXT command") Fixes: 80ab300b ("KVM: SVM: CSV: Add KVM_CSV3_RECEIVE_ENCRYPT_DATA command") Fixes: f11dc54e ("KVM: SVM: CSV: Add KVM_CSV3_RECEIVE_ENCRYPT_CONTEXT command") Fixes: c97c1d01 ("KVM: SVM: CSV: Add ioctl API to unpin shared pages of CSV3 guest") Signed-off-by:hanliyang <hanliyang@hygon.cn>