Bug 907822 (CVE-2010-5313) - VUL-0: CVE-2010-5313: kernel: kvm: x86: Don't report L2 emulation failures to user-space
Summary: VUL-0: CVE-2010-5313: kernel: kvm: x86: Don't report L2 emulation failures to...
Status: RESOLVED FIXED
Alias: CVE-2010-5313
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Michal Hocko
QA Contact: Security Team bot
URL:
Whiteboard: CVSSv2:NVD:CVE-2010-5313:4.9:(AV:L/AC...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-01 17:13 UTC by Alexander Bergmann
Modified: 2020-05-12 17:44 UTC (History)
7 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Bergmann 2014-12-01 17:13:14 UTC
Via NIST: CVE-2010-5313

Race condition in arch/x86/kvm/x86.c in the Linux kernel before 2.6.38 allows L2 guest OS users to cause a denial of service (L1 guest OS crash) via a crafted instruction that triggers an L2 emulation failure report, a similar issue to CVE-2014-7842.

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-5313
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=fc3a9157d3148ab91039c75423da8ef97be3e105
Comment 3 Michal Hocko 2014-12-02 07:15:26 UTC
SLE11-SP1-TD is obviously missing 6d77dbfc88e3 (KVM: inject #UD if instruction emulation fails and exit to userspace). I guess we want it as well as it is providing a common error handling for more paths. The patch however removes kvm_report_emulation_failure which is exported for modules and thus breaks the kABI.

Joerg could you help me out please? Maybe we need the fix only for the emulation path?
Comment 4 Michal Hocko 2014-12-02 07:20:41 UTC
Btw. this seems to be a duplicate of bug 905312. The other bug mentions two commits and has a different CVE number so I am not closing it as such. Maybe the other bug should care only about a2b9e6c1a35a (KVM: x86: Don't report guest userspace emulation error to userspace)
Comment 5 Joerg Roedel 2014-12-02 09:27:34 UTC
(In reply to Michal Hocko from comment #3)
> SLE11-SP1-TD is obviously missing 6d77dbfc88e3 (KVM: inject #UD if
> instruction emulation fails and exit to userspace). I guess we want it as
> well as it is providing a common error handling for more paths. The patch
> however removes kvm_report_emulation_failure which is exported for modules
> and thus breaks the kABI.
> 
> Joerg could you help me out please? Maybe we need the fix only for the
> emulation path?

I think we can apply the patch and keep kvm_report_emulation_failure around. I'll try to come up with a patch for SLE11-SP1-TD.
Comment 6 Joerg Roedel 2014-12-02 10:05:21 UTC
On the other hand, this issue is only about nested virtualization (which is only implemented for SVM in the SLE11-SP1-TD kernel).

This kernel has a lot of other security problems in nested virt, so we could also just disable this feature permanently and be safe again.

The kernel has also no support for nested NPT, so that any L2 guest will be very slow anyway, I doubt that anyone uses this feature in production.

Opinions?
Comment 7 Jiri Kosina 2014-12-02 10:12:58 UTC
(In reply to Joerg Roedel from comment #6)
> On the other hand, this issue is only about nested virtualization (which is
> only implemented for SVM in the SLE11-SP1-TD kernel).
> 
> This kernel has a lot of other security problems in nested virt, so we could
> also just disable this feature permanently and be safe again.

Good point. I am pretty sure that nested virtualization is not supported by us in any means, especially in SLE11, right?
Comment 8 Joerg Roedel 2014-12-02 10:19:23 UTC
(In reply to Jiri Kosina from comment #7)
> (In reply to Joerg Roedel from comment #6)
> > On the other hand, this issue is only about nested virtualization (which is
> > only implemented for SVM in the SLE11-SP1-TD kernel).
> > 
> > This kernel has a lot of other security problems in nested virt, so we could
> > also just disable this feature permanently and be safe again.
> 
> Good point. I am pretty sure that nested virtualization is not supported by
> us in any means, especially in SLE11, right?

I would be very surprised if it is supported. SUSE would be the first company I know of that support nested virt in any product :)

Also the nested virt code is still pretty experimental in 2.6.32.
Comment 10 Bruce Rogers 2014-12-02 13:10:11 UTC
(In reply to Jiri Kosina from comment #7)
> (In reply to Joerg Roedel from comment #6)
> > On the other hand, this issue is only about nested virtualization (which is
> > only implemented for SVM in the SLE11-SP1-TD kernel).
> > 
> > This kernel has a lot of other security problems in nested virt, so we could
> > also just disable this feature permanently and be safe again.
> 
> Good point. I am pretty sure that nested virtualization is not supported by
> us in any means, especially in SLE11, right?

Nested virtualization is certainly not supported in SP1, and has been tech preview for SP3 and still for SLE12.

I would be fine with it being disabled for the TD kernel, if TD also agrees.
Comment 13 Roberto Angelino 2014-12-02 14:50:14 UTC
(In reply to Joerg Roedel from comment #12)
> (In reply to roberto angelino from comment #11)
> > (In reply to Michal Hocko from comment #9)
> > > Let's add Roberto to get TD opinion on that. See the last three comments.
> > 
> > Just to be clear, we are talking about sles11.sp1 KVM guest(s) here right?
> 
> No, the bug affects sles11.sp1 kvm host(s).

The environment that Teradata will be using in kvm is sles11 sp3 hosts with sles11 sp1 guests.  Now that's not to say a customer can do something stupid like run kvm on a sles11 sp1 host.  What exactly are we proposing to disable so the CVE would be invalid?  Because in the past even if they don't use a particular sles feature and a CVE is against it, they ask for the fix anyway since a customer who could potentially use it, can use it and then they are vulnerable.
Comment 14 Joerg Roedel 2014-12-02 16:21:03 UTC
(In reply to Roberto Angelino from comment #13)

> The environment that Teradata will be using in kvm is sles11 sp3 hosts with
> sles11 sp1 guests.  Now that's not to say a customer can do something stupid
> like run kvm on a sles11 sp1 host.  What exactly are we proposing to disable
> so the CVE would be invalid?  Because in the past even if they don't use a
> particular sles feature and a CVE is against it, they ask for the fix anyway
> since a customer who could potentially use it, can use it and then they are
> vulnerable.

If TD only runs sles11-sp1 in KVM guests there is a very high chance they are not using KVM on that platform at all (as that would already be nested virtualization, which is not supported by us). Also the plan is to disable nested-virt completly, so that it could not be re-enabled by the user.
Comment 15 Roberto Angelino 2014-12-02 21:17:23 UTC
(In reply to Joerg Roedel from comment #12)
> (In reply to roberto angelino from comment #11)
> > (In reply to Michal Hocko from comment #9)
> > > Let's add Roberto to get TD opinion on that. See the last three comments.
> > 
> > Just to be clear, we are talking about sles11.sp1 KVM guest(s) here right?
> 
> No, the bug affects sles11.sp1 kvm host(s).

OK.  The issue is against sles11 sp1 kvm host which I KNOW they don't use, BUT that doesn't mean they won't want the CVE.  Let me ask them.
Comment 16 Roberto Angelino 2014-12-03 19:27:10 UTC
Teradata says they do not want to disable kvm.  And they do want the patch even though they do not support sles11.sp1 kvm hosts configuration.
Comment 17 Bruce Rogers 2014-12-03 20:29:03 UTC
(In reply to Roberto Angelino from comment #16)
> Teradata says they do not want to disable kvm.  And they do want the patch
> even though they do not support sles11.sp1 kvm hosts configuration.

Jut to be clear, my comment #10 was about disabling in the SP1 TD kernel the ability do do nested virtualization, not to disable kvm entirely. Not that I am determined that that is the appropriate solution, but since it had been mentioned in comment #6 as an option, I chimed in agreeing that that would be a fairly easy way to avoid all nested virtualization security vulnerabilities in the TD kernel.
Comment 18 Alexander Graf 2014-12-04 01:01:06 UTC
I think it's a very good and safe choice to disable nested virt. In fact, isn't it disabled by default with a module option in SP1 still?

In that case, users will have to proactively enable a known-broken, known-insecure, unsupported feature to ever run into this security problem.
Comment 19 Bruce Rogers 2014-12-04 02:20:53 UTC
(In reply to Alexander Graf from comment #18)
> I think it's a very good and safe choice to disable nested virt. In fact,
> isn't it disabled by default with a module option in SP1 still?
> 
> In that case, users will have to proactively enable a known-broken,
> known-insecure, unsupported feature to ever run into this security problem.

In SP1, only svm does nested virtualization, and it was enabled by default.
Comment 20 Alexander Graf 2014-12-04 02:47:48 UTC
Ah, Jörg enabled it by default back in 2.6.32 with commit 4b6e4dca701. If we simply revert that commit I think we're set.
Comment 21 Joerg Roedel 2014-12-10 14:08:29 UTC
Okay, for now I backported the following commits to the SLE11-SP1-TD branch:

6d77dbfc KVM: inject #UD if instruction emulation fails and exit to userspace
ec9e60b2 KVM: X86: Introduce generic guest-mode representation
2030753d KVM: SVM: Make Use of the generic guest-mode functions
fc3a9157 KVM: X86: Don't report L2 emulation failures to user-space
a2b9e6c1 KVM: x86: Don't report guest userspace emulation error to userspace

This are the patches with their prerequisites to fix CVE-2010-5313 and the related CVE-2014-7842.

This should be what TD requested. Nevertheless I still suggest to permanently disable nested virtualization on that kernel, as there are other problems left.

The patches are only compile-tested so far, I'll try to give them some runtime testing too to check if KVM still works. Especially the backport of the first patch turned out to be ugly and complicated and I want to make sure it does not break everything.
Comment 22 Roberto Angelino 2014-12-10 20:30:31 UTC
(In reply to Joerg Roedel from comment #21)
> Okay, for now I backported the following commits to the SLE11-SP1-TD branch:
> 
> 6d77dbfc KVM: inject #UD if instruction emulation fails and exit to userspace
> ec9e60b2 KVM: X86: Introduce generic guest-mode representation
> 2030753d KVM: SVM: Make Use of the generic guest-mode functions
> fc3a9157 KVM: X86: Don't report L2 emulation failures to user-space
> a2b9e6c1 KVM: x86: Don't report guest userspace emulation error to userspace
> 
> This are the patches with their prerequisites to fix CVE-2010-5313 and the
> related CVE-2014-7842.
> 
> This should be what TD requested. Nevertheless I still suggest to
> permanently disable nested virtualization on that kernel, as there are other
> problems left.

Joerg,
   I talked to Qiyan & he's OK with disabling nested virtualization.  But I need Milad's OK.  He's out to lunch right now.  I'll update the bug once I talk to him.
Comment 23 Roberto Angelino 2014-12-11 17:53:13 UTC
> > This should be what TD requested. Nevertheless I still suggest to
> > permanently disable nested virtualization on that kernel, as there are other
> > problems left.
> 
> Joerg,
>    I talked to Qiyan & he's OK with disabling nested virtualization.  But I
> need Milad's OK.  He's out to lunch right now.  I'll update the bug once I
> talk to him.

Milad says he's ok also with compiling out nested virtualization in their sles11.sp1 kernel.  Only thing is we have to reference the CVE & comment it in changelog so their customer service reps can check if anyone queries about it.

Thanks
Comment 24 Michal Hocko 2014-12-16 14:50:41 UTC
pushed to SLE11-SP1-TD. Thanks a lot Joerg!
Comment 25 Victor Pereira 2014-12-29 10:04:40 UTC
released
Comment 26 Swamp Workflow Management 2015-04-02 00:10:44 UTC
SUSE-SU-2015:0652-1: An update that solves 17 vulnerabilities and has 10 fixes is now available.

Category: security (important)
Bug References: 771619,833820,846404,857643,875051,885077,891211,892235,896390,896391,896779,899338,902346,902349,902351,904700,905100,905312,907822,908870,911325,912654,912705,912916,913059,915335,915826
CVE References: CVE-2010-5313,CVE-2012-6657,CVE-2013-4299,CVE-2013-7263,CVE-2014-0181,CVE-2014-3184,CVE-2014-3185,CVE-2014-3673,CVE-2014-3687,CVE-2014-3688,CVE-2014-7841,CVE-2014-7842,CVE-2014-8160,CVE-2014-8709,CVE-2014-9420,CVE-2014-9584,CVE-2014-9585
Sources used:
SUSE Linux Enterprise Server 11 SP1 LTSS (src):    kernel-default-2.6.32.59-0.19.1, kernel-ec2-2.6.32.59-0.19.1, kernel-pae-2.6.32.59-0.19.1, kernel-source-2.6.32.59-0.19.1, kernel-syms-2.6.32.59-0.19.1, kernel-trace-2.6.32.59-0.19.1, kernel-xen-2.6.32.59-0.19.1, xen-4.0.3_21548_18-0.9.17
SLE 11 SERVER Unsupported Extras (src):    kernel-default-2.6.32.59-0.19.1, kernel-pae-2.6.32.59-0.19.1, kernel-xen-2.6.32.59-0.19.1