Re: Problem with UBSAN warning

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

 







Hi,
Kmod 4.4.11 got a warning when checked by UBSAN.
Does anybody know what is going on? Or any commit can fix this?

It's fixed by this commit:

    commit b2740d3533a3f4aeb9553e872ce471ff73200a7f
    Author: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    Date:   Tue Feb 23 15:36:01 2016 +0100

    KVM: ensure __gfn_to_pfn_memslot initializes *writable

    For the kvm_is_error_hva, ubsan complains if the uninitialized writable
    is passed to __direct_map, even though the value itself is not used
    (__direct_map goes to mmu_set_spte->set_spte->set_mmio_spte but never
    looks at that argument).

    Ensuring that __gfn_to_pfn_memslot initializes *writable is cheap and
    avoids this kind of issue.

    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>

See also commit 0a47cd85833e56574a926cad309726f4f7859544 for another
ubsan fix.

Paolo

Patch works well!

Thanks Paolo

[ 9410.857177]
================================================================================
[ 9410.865994] UBSAN: Undefined behaviour in
/home/abuild/rpmbuild/BUILD/kvm-4.4.11/source/x86/mmu.c:3573:6
[ 9410.875822] load of value 161 is not a valid value for type '_Bool'
[ 9410.882275] CPU: 19 PID: 21927 Comm: CPU 0/KVM Tainted: G    B      OE
---- -------   3.10.0-327.28.3_debug.30.x86_64 #1
[ 9410.893573] Hardware name: Huawei CH121 V3/IT11SGCA1, BIOS 3.18 04/05/2016
[ 9410.900590]  ffffffffa1dd0790 0000000032e6cc9b ffff880c0787f488
ffffffff81ee314c
[ 9410.908456]  ffff880c0787f4a0 ffffffff81ee3209 ffffffffa1dd0780
ffff880c0787f590
[ 9410.916319]  ffffffff81ee3c2c 0000000041b58ab3 ffffffff8240c6a8
ffffffff81ee3b14
[ 9410.924191] Call Trace:
[ 9410.926852]  [<ffffffff81ee314c>] dump_stack+0x1e/0x20
[ 9410.932177]  [<ffffffff81ee3209>] ubsan_epilogue+0x12/0x55
[ 9410.937851]  [<ffffffff81ee3c2c>]
__ubsan_handle_load_invalid_value+0x118/0x162
[ 9410.945520]  [<ffffffff81ee3b14>] ? val_to_string.constprop.12+0x114/0x114
[ 9410.952628]  [<ffffffffa1ca80c6>] ? make_mmu_pages_available+0x1e6/0x290
[kvm]
[ 9410.960248]  [<ffffffffa1ca7ee0>] ? kvm_mmu_prepare_zap_page+0x990/0x990
[kvm]
[ 9410.967867]  [<ffffffffa1c9a9dd>] ? handle_abnormal_pfn+0x5d/0x1f0 [kvm]
[ 9410.974790]  [<ffffffffa1cacd2f>] tdp_page_fault+0x69f/0x790 [kvm]
[ 9410.981198]  [<ffffffffa1cac690>] ? nonpaging_page_fault+0x6a0/0x6a0 [kvm]
[ 9410.988297]  [<ffffffffa1cd34c0>] ? picdev_eclr_write+0x40/0x40 [kvm]
[ 9410.994956]  [<ffffffffa1c50239>] ? kvm_io_bus_write+0xe9/0x170 [kvm]
[ 9411.001579]  [<ffffffffa1c50150>] ? __kvm_io_bus_write+0x280/0x280 [kvm]
[ 9411.008501]  [<ffffffffa1c9ba20>] kvm_mmu_page_fault+0x50/0x320 [kvm]
[ 9411.015110]  [<ffffffffa60c1fa9>] handle_ept_violation+0xd9/0x2a0
[kvm_intel]
[ 9411.022438]  [<ffffffffa60c1ed0>] ? clear_atomic_switch_msr+0x400/0x400
[kvm_intel]
[ 9411.030400]  [<ffffffffa60d71c2>] vmx_handle_exit+0x7b2/0x1fc0 [kvm_intel]
[ 9411.037461]  [<ffffffffa60c2c80>] ? copy_shadow_to_vmcs12+0x430/0x430
[kvm_intel]
[ 9411.045319]  [<ffffffffa60d6a10>] ? handle_invvpid+0x660/0x660 [kvm_intel]
[ 9411.052419]  [<ffffffffa1cde54d>] ? kvm_lapic_sync_to_vapic+0x10d/0x6a0
[kvm]
[ 9411.059755]  [<ffffffffa60c02d8>] ? vmx_save_host_state+0xa8/0x4a0
[kvm_intel]
[ 9411.067347]  [<ffffffffa60b9a80>] ? move_msr_up+0x160/0x160 [kvm_intel]
[ 9411.074148]  [<ffffffff81183609>] ? __srcu_read_lock+0xc9/0x140
[ 9411.080292]  [<ffffffffa1c8ccd6>] vcpu_enter_guest+0x1916/0x2da0 [kvm]
[ 9411.087008]  [<ffffffffa1c8b3c0>] ? kvm_load_guest_fpu+0x1b0/0x1b0 [kvm]
[ 9411.093900]  [<ffffffff81148f90>] ? signal_setup_done+0x110/0x110
[ 9411.100222]  [<ffffffffa1ceefbb>] ?
kvm_check_async_pf_completion+0x11b/0x150 [kvm]
[ 9411.108288]  [<ffffffffa1c9211f>] kvm_arch_vcpu_ioctl_run+0x58f/0xb10
[kvm]
[ 9411.115443]  [<ffffffffa60be250>] ? fix_rmode_seg+0x350/0x350 [kvm_intel]
[ 9411.122452]  [<ffffffffa1c91b90>] ? kvm_arch_vcpu_runnable+0x340/0x340
[kvm]
[ 9411.129726]  [<ffffffffa1c813f1>] ? kvm_arch_vcpu_load+0x1a1/0x490 [kvm]
[ 9411.136649]  [<ffffffffa1c5a7ea>] kvm_vcpu_ioctl+0x54a/0xae0 [kvm]
[ 9411.143047]  [<ffffffffa1c5a2a0>] ? vcpu_put+0x30/0x30 [kvm]
[ 9411.148899]  [<ffffffff81207550>] ? get_futex_key_refs+0xb0/0xb0
[ 9411.155095]  [<ffffffff814866f0>] ? poll_select_copy_remaining+0x380/0x380
[ 9411.162156]  [<ffffffff81209173>] ? futex_wake+0x113/0x380
[ 9411.167827]  [<ffffffff81209060>] ? wake_futex+0xf0/0xf0
[ 9411.177137]  [<ffffffff8150cff6>] ? eventfd_write+0x216/0x6f0
[ 9411.183069]  [<ffffffff8120e52b>] ? do_futex+0x19b/0xb60
[ 9411.188567]  [<ffffffffa1c5a2a0>] ? vcpu_put+0x30/0x30 [kvm]
[ 9411.194418]  [<ffffffff81484ec1>] do_vfs_ioctl+0x741/0xb40
[ 9411.200092]  [<ffffffff81484780>] ? ioctl_preallocate+0x230/0x230
[ 9411.206378]  [<ffffffff811a3e20>] ? wake_up_state+0x20/0x20
[ 9411.212138]  [<ffffffff814f6db3>] ? __fsnotify_parent+0x53/0x210
[ 9411.218335]  [<ffffffff815e48ae>] ? cap_file_ioctl+0xe/0x20
[ 9411.224093]  [<ffffffff814853f2>] SyS_ioctl+0x132/0x170
[ 9411.229506]  [<ffffffff814852c0>] ? do_vfs_ioctl+0xb40/0xb40
[ 9411.235355]  [<ffffffff81efc2f4>] ? do_page_fault+0x44/0xa0
[ 9411.241118]  [<ffffffff81f089c9>] system_call_fastpath+0x16/0x1b
[ 9411.247303]
================================================================================



.


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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