[bug report] KVM: SVM: hyper-v: Enlightened MSR-Bitmap support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Vineeth Pillai,

This is a semi-automatic email about new static checker warnings.

The patch c4327f15dfc7: "KVM: SVM: hyper-v: Enlightened MSR-Bitmap 
support" from Jun 3, 2021, leads to the following Smatch complaint:

    arch/x86/kvm/svm/svm_onhyperv.h:92 svm_hv_vmcb_dirty_nested_enlightenments()
    warn: variable dereferenced before check 'vmcb' (see line 84)

arch/x86/kvm/svm/svm_onhyperv.h
    83		struct hv_enlightenments *hve =
    84			(struct hv_enlightenments *)vmcb->control.reserved_sw;
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^
Dereferenced

    85	
    86		/*
    87		 * vmcb can be NULL if called during early vcpu init.
                   ^^^^^^^^^^^^^^^^
Probably shouldn't be Dereferenced

    88		 * And its okay not to mark vmcb dirty during vcpu init
    89		 * as we mark it dirty unconditionally towards end of vcpu
    90		 * init phase.
    91		 */
    92		if (vmcb && vmcb_is_clean(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS) &&
                    ^^^^

    93		    hve->hv_enlightenments_control.msr_bitmap)
    94			vmcb_mark_dirty(vmcb, VMCB_HV_NESTED_ENLIGHTENMENTS);

regards,
dan carpenter



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux