* Patch "KVM: x86/vPMU: fix undefined shift in intel_pmu_refresh()" has been added to the 4.4-stable tree
@ 2017-07-03 13:04 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-07-03 13:04 UTC (permalink / raw)
To: rkrcmar, dan.carpenter, david, gregkh, pbonzini; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
KVM: x86/vPMU: fix undefined shift in intel_pmu_refresh()
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
kvm-x86-vpmu-fix-undefined-shift-in-intel_pmu_refresh.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 34b0dadbdf698f9b277a31b2747b625b9a75ea1f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= <rkrcmar@redhat.com>
Date: Thu, 18 May 2017 19:37:31 +0200
Subject: KVM: x86/vPMU: fix undefined shift in intel_pmu_refresh()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Radim Krčmář <rkrcmar@redhat.com>
commit 34b0dadbdf698f9b277a31b2747b625b9a75ea1f upstream.
Static analysis noticed that pmu->nr_arch_gp_counters can be 32
(INTEL_PMC_MAX_GENERIC) and therefore cannot be used to shift 'int'.
I didn't add BUILD_BUG_ON for it as we have a better checker.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 25462f7f5295 ("KVM: x86/vPMU: Define kvm_pmu_ops to support vPMU function dispatch")
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kvm/pmu_intel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/kvm/pmu_intel.c
+++ b/arch/x86/kvm/pmu_intel.c
@@ -294,7 +294,7 @@ static void intel_pmu_refresh(struct kvm
((u64)1 << edx.split.bit_width_fixed) - 1;
}
- pmu->global_ctrl = ((1 << pmu->nr_arch_gp_counters) - 1) |
+ pmu->global_ctrl = ((1ull << pmu->nr_arch_gp_counters) - 1) |
(((1ull << pmu->nr_arch_fixed_counters) - 1) << INTEL_PMC_IDX_FIXED);
pmu->global_ctrl_mask = ~pmu->global_ctrl;
Patches currently in stable-queue which might be from rkrcmar@redhat.com are
queue-4.4/kvm-nvmx-fix-exception-injection.patch
queue-4.4/kvm-x86-vpmu-fix-undefined-shift-in-intel_pmu_refresh.patch
queue-4.4/kvm-x86-zero-base3-of-unusable-segments.patch
queue-4.4/kvm-x86-fix-fixing-of-hypercalls.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-03 13:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-03 13:04 Patch "KVM: x86/vPMU: fix undefined shift in intel_pmu_refresh()" has been added to the 4.4-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox