Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI
Quoted 7 lines
Quoted 1 line
Quoted 1 line
"Cihula, Joseph" 05/16/11 11:34 PM >>>
IOMMU adds security capabilities. IR adds additional security capabilities. IOMMU allows for fully isolating the hypervisor from domains even if the domains control DMA devices. It helps to protect against buggy drivers or device FW by limiting the areas such bugs can affect to just the DMA data buffers. IOMMU, in conjunction with Intel(R) Trusted Execution Technology (TXT), provides DMA protection through the entire launch process and into runtime. This is all true regardless of the presence of IR. IR adds the ability to prevent DoS attacks by untrusted domains with assigned DMA devices, malicious device FW, etc. This is incremental--not all or nothing.
I think this is the problem - you're saying things like "fully isolating" and "regardless of the presence of IR", while the paper they made accessible meanwhile makes clear that neither is true. Thus the mere presence of DMA protection creates false expectation of customers - without IR (and with MSI supported by the system, not necessarily the device passed through) there's no way for isolation to become complete (actually, with non-MSI-capable devices or by disallowing MSI altogether on capable ones, depending of whether MSI writes bypass the IOMMU or simply get 1:1 translated, it could be possible to make this secure).
Quoted 1 line
The 00-block-msis-on-trap-vectors patch (esp. in conjunction with TXT) prevents all known security exploits of MSI misuse.
All? Not really, just a very small subset, and only partially. The SIPI one is perhaps the worst case (not prevented by this patch), but being able to send SMI or NMI perhaps isn't much better (as long as we're considering DoS attacks to also be a problem, which at least I do, and in which case said patch only converts from one [worse] to another ["better"] evil).
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
From: Jan Beulich [mailto:[email protected]]
Sent: Tuesday, May 17, 2011 12:43 AM
To: [email protected]; Cihula, Joseph
Cc: [email protected]
Subject: RE: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI
Quoted 7 lines
Quoted 1 line
Quoted 1 line
"Cihula, Joseph" <[email protected]<mailto:[email protected]>> 05/16/11 11:34 PM >>>
IOMMU adds security capabilities. IR adds additional security capabilities. IOMMU allows for fully isolating the hypervisor from domains even if the domains control DMA devices. It helps to protect against buggy drivers or device FW by limiting the areas such bugs can affect to just the DMA data buffers. IOMMU, in conjunction with Intel(R) Trusted Execution Technology (TXT), provides DMA protection through the entire launch process and into runtime. This is all true regardless of the presence of IR. IR adds the ability to prevent DoS attacks by untrusted domains with assigned DMA devices, malicious device FW, etc. This is incremental--not all or nothing.
I think this is the problem - you're saying things like "fully isolating" and "regardless of the presence of IR", while the paper they made accessible [JC] I will admit to being a little overreaching in use of that adverb; let's remove "fully" and my statement still stands.
meanwhile makes clear that neither is true. Thus the mere presence of DMA protection creates false expectation of customers - without IR (and with MSI supported by the system, not necessarily the device passed through) there's no way for isolation to become complete (actually, with non-MSI-capable devices or by disallowing MSI altogether on capable ones, depending of whether MSI writes bypass the IOMMU or simply get 1:1 translated, it could be possible to make this secure). [JC] The expectations of users will depend on the features advertised and how they are implemented in the SW solutions that use IOMMU. Such SW should not be advertising DoS protection if devices are assigned to untrusted domains on systems without IR. Just like it should not advertise that on systems without IOMMU. (Note that the DMA protection of IOMMU should prevent most/all accidental/buggy behaviors; MSI DoS would almost certainly have to be due to malicious code.)
Quoted 1 line
The 00-block-msis-on-trap-vectors patch (esp. in conjunction with TXT) prevents all known security exploits of MSI misuse.
All? Not really, just a very small subset, and only partially. The SIPI one is perhaps the worst case (not prevented by this patch), but being able to send SMI or NMI perhaps isn't much better (as long as we're considering DoS attacks to also be a problem, which at least I do, and in which case said patch only converts from one [worse] to another ["better"] evil). [JC] I didn't say "all exploits"-I said all *known* exploits, and that is correct. The SIPI attack, which isn't known to be exploitable, is prevented by TXT (hence the "esp. in conjunction with TXT" in my statement). Naturally, DoS attacks are problematic from a reliability perspective but they were not what I was referring to with the term "security exploit".
I still fail to see an argument that justifies panic'ing Xen when IOMMU is enabled on non-IR systems. And I don't think the way to manage customer expectations is through SW freezing.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 3 lines · Joseph
I still fail to see an argument that justifies panic’ing Xen when IOMMU is enabled on non-IR systems. And I don’t think the way to manage customer expectations is through SW freezing.
Leaving the iommu=on behaviour the same as today but making iommu=force require IR (with an explicit opt-out a la iommu=force,no-intremap) is possibly sufficient (and considerably less harsh than the previous proposal).
Perhaps something like the following?
# HG changeset patch
# Parent 3db330334e3512a5326bbed4881718a63eec171a
xen/drivers/passthrough/vtd/iommu.c +1 -1
@@ -1987,7 +1987,7 @@ static int init_vtd_hw(void) dprintk(XENLOG_WARNING VTDPREFIX, "Interrupt Remapping not enabled\n"); -if ( force_iommu &&platform_supports_intremap () ) +if ( force_iommu )panic ("intremap remapping failed to enable with iommu=required/force in grub\n" );break ; }
I also considered
+ if ( force_iommy && ( !tboot_in_measured_env() || platform_supports_intremap() )
but I trusting the result of tboot_in_measured_env() in the non-TXT case seems a bit silly.
Ian.
Quoted 28 lines
From: Ian Campbell [mailto:[email protected]]
Sent: Wednesday, May 18, 2011 1:54 AMQuoted 3 lines · Joseph
I still fail to see an argument that justifies panic’ing Xen when IOMMU is enabled on non-IR systems. And I don’t think the way to manage customer expectations is through SW freezing.
Leaving the iommu=on behaviour the same as today but making iommu=force require IR (with an explicit opt-out a la iommu=force,no-intremap) is possibly sufficient (and considerably less harsh than the previous proposal).
Perhaps something like the following?
# HG changeset patch
# Parent3db330334e3512a5326bbed4881718a63eec171a
diff -r3db330334e35-r975cd3817d7axen/drivers/passthrough/vtd/iommu.cxen/drivers/passthrough/vtd/iommu.c +1
-1@@ -1987,7 +1987,7 @@ static int init_vtd_hw(void) dprintk(XENLOG_WARNING VTDPREFIX, "Interrupt Remapping not enabled\n"); -if ( force_iommu &&platform_supports_intremap () ) +if ( force_iommu )panic ("intremap remapping failed to enable with iommu=required/force in grub\n");break ;
Quoted 1 line
}
So how would the user (or installation SW) specify to use the best (IOMMU) security available on the platform? It looks like this change would again either mean giving up on forcing IOMMU or having to alter the command line based on knowing what the platform's IR capability is.
I think that it is desirable to have an option that says "use the best IOMMU security supported by the platform", and "force" does that right now.
Since what you're really trying to do is to always force IR to be on, why not just create a new option "force-intr"? Or if your goal is to force the use of the best security capabilities available on any platform, and fail on the rest, then define a new option for that.
Quoted 6 lines
I also considered
+ if (force_iommy&& ( !tboot_in_measured_env() ||
+platform_supports_intremap())but I trusting the result of
tboot_in_measured_env()in the non-TXT case seems a bit silly.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 2 lines · Joseph
So how would the user (or installation SW) specify to use the best (IOMMU) security available on the platform?
iommu=on. That pretty much lines up with the current meaining.
Only iommu=force requires a fully secure IOMMU, and you can overide that with iommu=force,nointremap.
Tim.
Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)
Quoted 8 lines
From: Tim Deegan [mailto:[email protected]]
Sent: Friday, May 20, 2011 3:17 AMQuoted 2 lines · Joseph
So how would the user (or installation SW) specify to use the best (IOMMU) security available on the platform?
iommu=on. That pretty much lines up with the current meaining.
'iommu=on' is really "*try* to use the best but it's OK if you can't", as it will allow execution to continue even if enabling the supported features fails. 'force' is really this with the caveat that execution won't continue if it fails to enable them.
Quoted 2 lines
Only iommu=force requires a fully secure IOMMU, and you can overide that with iommu=force,nointremap.
But as I said, if you're writing a Xen installer and you want to *ensure* that Xen uses the HW features of the system, are you going to make some table that tells whether any given system supports IR so that you know which ones to add ',nointremap' to? Because if you try to detect it at install time, malware could convince you to disable IR even though the HW supports it and TXT would report correctly to Xen.
What is the reason for not creating a new option that supports your desired behavior?
Joe
Quoted 7 lines
Tim.
--
Tim Deegan <[email protected]>
Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)
Quoted 10 lines · Joseph
Quoted 5 lines
Quoted 2 lines · Joseph
So how would the user (or installation SW) specify to use the best (IOMMU) security available on the platform?
iommu=on. That pretty much lines up with the current meaining.
'iommu=on' is really "*try* to use the best but it's OK if you can't", as it will allow execution to continue even if enabling the supported features fails. 'force' is really this with the caveat that execution won't continue if it fails to enable them.
Yes, exactly. By extension, "on" turns on interrupt remapping if it's there but "it's OK if you can't"; "force" requires it. I don't understand why you would want iommu=force to crash if the IOMMU is missing but not if it's insecure.
Quoted 4 lines
But as I said, if you're writing a Xen installer and you want to *ensure* that Xen uses the HW features of the system, are you going to make some table that tells whether any given system supports IR so that you know which ones to add ',nointremap' to?
This is exactly the behaviour we already have if you don't have an iommu at all. The installer already needs to figure out whether there's an IOMMU, or make it optional.
If you really want to rely on TXT and Xen to mutuallly secure each other, then as far as I can see you _need_ an interrupt remapper in all your supported hardware. That being the case, iommu=force should enforce that requirement. If you're willing to settle for best-effort, iommu=on already does that.
Tim.
Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)
Quoted 24 lines
From: Tim Deegan [mailto:[email protected]]
Sent: Sunday, May 22, 2011 11:14 AMQuoted 10 lines · Joseph
Quoted 5 lines
Quoted 2 lines · Joseph
So how would the user (or installation SW) specify to use the best (IOMMU) security available on the platform?
iommu=on. That pretty much lines up with the current meaining.
'iommu=on' is really "*try* to use the best but it's OK if you can't", as it will allow execution to continue even if enabling the supported features fails. 'force' is really this with the caveat that execution won't continue if it fails to enable them.
Yes, exactly. By extension, "on" turns on interrupt remapping if it's there but "it's OK if you can't"; "force" requires it. I don't understand why you would want iommu=force to crash if the IOMMU is missing but not if it's insecure.
Quoted 4 lines
But as I said, if you're writing a Xen installer and you want to *ensure* that Xen uses the HW features of the system, are you going to make some table that tells whether any given system supports IR so that you know which ones to add ',nointremap' to?
Quoted 5 lines
This is exactly the behaviour we already have if you don't have an iommu at all. The installer already needs to figure out whether there's an IOMMU, or make it optional.
If you really want to rely on TXT and Xen to mutuallly secure each other, then as far as I can see you _need_ an interrupt remapper in all your supported hardware. That being the case, iommu=force
Let me take one more shot at this, since no one has yet refuted my original points.
Why do you *need* IR to have a secure Xen w/ TXT? Certainly a DoS is very undesirable, but that is not really a security issue. Tell me what security exploits are still possible with the current patches.
If this all revolves around "gut feel" and not actual technical issues, then I suppose there isn't much more I can say. But the "argument" that without IR "it seems like we could do more bad things" is purely speculative. Likewise, the "argument" that "just because only the mitigated attack was presented doesn't mean that there aren't others possible" is also meaningless--this same reasoning applies to any attack, and so just because there is one buffer overflow found (e.g. CVE-2008-3687) do you panic Xen because there could be others that just haven't been found yet?
If someone can present a security issue that TXT and SW patches cannot mitigate, then I would agree that it is not possible to secure a system without IR and it should be forced on. If you can't make this claim then I don't see how you have a technical basis for your position.
Joe
Quoted 9 lines
should enforce that requirement. If you're willing to settle for best-effort, iommu=on already does that.
Tim.
--
Tim Deegan <[email protected]>
Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)
Quoted 6 lines · Joseph
Quoted 5 lines
This is exactly the behaviour we already have if you don't have an iommu at all. The installer already needs to figure out whether there's an IOMMU, or make it optional.
If you really want to rely on TXT and Xen to mutuallly secure each other, then as far as I can see you _need_ an interrupt remapper in all your supported hardware. That being the case, iommu=force
Quoted 6 lines
Let me take one more shot at this, since no one has yet refuted my original points.
Why do you *need* IR to have a secure Xen w/ TXT? Certainly a DoS is very undesirable, but that is not really a security issue. Tell me what security exploits are still possible with the current patches.
The Invisible Things paper lists a selection of possible attack vectors. That they only developed and disclosed one actual exploit is, AIUI, as much a question of manpower as anything else. I haven't seen any analysis from Intel to suggest otherwise.
I think Ian's latest patch is the right thing to do. But since I'm not a maintainer of that piece of code, and since in practice the decision will be made for most people by product and distro engineers anyway, I'm not going to chase this thread around any more.
Cheers,
Tim.
Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)
Cihula, Joseph writes ("RE: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 2 lines
Why do you *need* IR to have a secure Xen w/ TXT? Certainly a DoS is very undesirable, but that is not really a security issue.
I'm afraid that a DoS is very much a security issue.
Quoted 2 lines
Tell me what security exploits are still possible with the current
patches.
As I understand it, a DoS (host crash) is still possible.
Quoted 1 line
If someone can present a security issue that TXT
I don't understand the contribution of TXT to this. The issue is with running untrusted guest kernels. Necessarily an untrusted guest kernel isn't checked by TXT; that's what "untrusted guest kernel" means.
Ian.
Quoted 9 lines
From: Ian Jackson [mailto:[email protected]]
Sent: Tuesday, May 24, 2011 9:57 AMCihula, Joseph writes ("RE: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 2 lines
Why do you *need* IR to have a secure Xen w/ TXT? Certainly a DoS is very undesirable, but that is not really a security issue.
I'm afraid that a DoS is very much a security issue.
Or a reliability/availability issue. It clearly is not in the same class as security issues that allow for code injection, privilege escalation, etc. You might even consider this as "fail secure" ;-)
Quoted 4 lines
Quoted 2 lines
Tell me what security exploits are still possible with the current
patches.As I understand it, a DoS (host crash) is still possible.
So you would rather cause the DoS as soon as Xen is run (via the panic) instead of if a guest actually tries to use an MSI attack? How does that make the system more secure?
So if we go back to another point I raised previously... If you commit your patch, what will be your instructions (to users, etc.) for specifying the 'iommu=' parameters? I would expect they would be "If your system supports IR then specify 'iommu=force'. If it supports IOMMU but not IR then specify 'iommu=force,nointremap'." (unless of course you want to say "If it supports IOMMU but not IR then throw it away and buy a new one that supports IR or use KVM instead."). Of course, the result is the same as the current 'iommu=force' behavior.
Quoted 7 lines
Quoted 2 lines
If someone can present a security issue that TXT
I don't understand the contribution of TXT to this. The issue is with running untrusted guest kernels. Necessarily an untrusted guest kernel isn't checked by TXT; that's what "untrusted guest kernel"
means.
TXT does two things: 1) it prevents the SIPI attack (by turning it into a DoS) and 2) it prevents malware from tricking Xen into not enabling IR on a system that supports it. The second one is what makes the current 'force' behavior the same on an IR system as your patch (i.e. panic/reset).
RE: Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI [and 2 more messages]
Cihula, Joseph writes ("RE: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 3 lines
None of the proposed patches check for whether passthrough is being used. Nor can they check whether it is being used safely (it may be used for performance by domains that are trusted).
Indeed. Providing that information is the purpose of the "iommu=required" command line option. That option is a declaration by the system administrator: "I will be using PCI passthrough and I need it to be secure".
A better arrangement would to prevent the use of PCI passthrough on insecure systems, at the time of device assignment, unless the sysadmin has explicitly specified "pci_passthrough_security=none" or something. But I imagine you would object to that even more.
Quoted 2 lines
Whether IR is required for a secure system with passthrough depends on the usage model (as I indicated in an earlier email).
If the usage model does not depend on Xen enforcing VM separation when PCI passthrough is used, then "iommu=on" is the correct boot option. We are only arguing about the behaviour when "iommu=required".
Quoted 4 lines
The user/distributor should decide whether their usage model
requires it or not. If it does, then all they need to do is run on HW that supports IR (and if they're worried about the pre-OS attack then use TXT, which would be necessary anyway).
If the user has specified "iommu=required" then it is a bug if the system then allows a domain to be created with pci passthrough devices in a way that allows the domain to attack the host.
The user should not be required to take additional steps to ensure that the system is secure. Your proposal would have the user have to inspect the boot output from Xen in detail in an effort to determine whether the hardware and software they had was working properly. (Determining the hardware feature support from marketing literature or pre-sales material is obviously not reliable.)
I'm not sure what you mean by "pre-OS attack". If you mean the situation with an untrusted guest kernel, that is a very common one and does not require the use of TXT. It simply requires Xen to properly enforce the VM boundary.
Cihula, Joseph writes ("RE: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 6 lines
Ian Jackson:
Quoted 1 line
I'm afraid that a DoS is very much a security issue.
Or a reliability/availability issue. It clearly is not in the same class as security issues that allow for code injection, privilege escalation, etc. You might even consider this as "fail secure" ;-)
I don't want to get into an argument about semantics. Nevertheless, protection against denial of service is a key requirement for most software. In other software projects, when DoS vulnerabilities are found, they issue a security advisory and fix the bug. We should do the same.
Quoted 5 lines
Quoted 1 line
As I understand it, a DoS (host crash) is still possible.
So you would rather cause the DoS as soon as Xen is run (via the panic) instead of if a guest actually tries to use an MSI attack? How does that make the system more secure?
This is getting ridiculous. I'm really starting to become quite cross. Please stop blocking the correct behaviour just because it's politically inconvenient.
(rest of my draft email snipped)
Ian.
RE: Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI [and 2 more messages]
Quoted 57 lines
From: Ian Jackson [mailto:[email protected]]
Sent: Wednesday, May 25, 2011 3:13 AMCihula, Joseph writes ("RE: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 3 lines
None of the proposed patches check for whether passthrough is being used. Nor can they check whether it is being used safely (it may be used for performance by domains that are trusted).
Indeed. Providing that information is the purpose of the "iommu=required" command line option. That option is a declaration by the system administrator: "I will be using PCI passthrough and I need it to be secure".
A better arrangement would to prevent the use of PCI passthrough on insecure systems, at the time of device assignment, unless the sysadmin has explicitly specified "pci_passthrough_security=none" or something. But I imagine you would object to that even more.
Quoted 2 lines
Whether IR is required for a secure system with passthrough depends on the usage model (as I indicated in an earlier email).
If the usage model does not depend on Xen enforcing VM separation when PCI passthrough is used, then "iommu=on" is the correct boot option.
We are only arguing about the behaviour when "iommu=required".Quoted 4 lines
The user/distributor should decide whether their usage model requires
it or not. If it does, then all they need to do is run on HW that supports IR (and if they're worried about the pre-OS attack then use TXT, which would be necessary anyway).If the user has specified "iommu=required" then it is a bug if the system then allows a domain to be created with pci passthrough devices in a way that allows the domain to attack the host.
The user should not be required to take additional steps to ensure that the system is secure. Your proposal would have the user have to inspect the boot output from Xen in detail in an effort to determine whether the hardware and software they had was working properly. (Determining the hardware feature support from marketing literature or pre-sales material is obviously not reliable.)
I'm not sure what you mean by "pre-OS attack". If you mean the situation with an untrusted guest kernel, that is a very common one and does not require the use of TXT. It simply requires Xen to properly enforce the VM boundary.
Cihula, Joseph writes ("RE: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 6 lines
Ian Jackson:
Quoted 1 line
I'm afraid that a DoS is very much a security issue.
Or a reliability/availability issue. It clearly is not in the same class as security issues that allow for code injection, privilege escalation, etc. You might even consider this as "fail secure" ;-)
I don't want to get into an argument about semantics. Nevertheless, protection against denial of service is a key requirement for most software. In other software projects, when DoS vulnerabilities are found, they issue a security advisory and fix the bug. We should do the same.
Quoted 2 lines
Quoted 1 line
As I understand it, a DoS (host crash) is still possible.
Quoted 8 lines
Quoted 3 lines
So you would rather cause the DoS as soon as Xen is run (via the panic) instead of if a guest actually tries to use an MSI attack? How does that make the system more secure?
This is getting ridiculous. I'm really starting to become quite cross. Please stop blocking the correct behaviour just because it's politically inconvenient.
(rest of my draft email snipped)
We'll just have to agree to disagree. So that said, Ian's (Campbell) last patch should undo the conditional coalescing.
Joe
Quoted 1 line
TXT does two things: 1) it prevents the SIPI attack (by turning it into a DoS) and 2) it prevents malware from tricking Xen into not enabling IR on a system that supports it. The second one is what makes the current 'force' behavior the same on an IR system as your patch (i.e. panic/reset).
1 is a rather curious redefinition of the word "prevents"
It reduces it to taking the system out. That's not "prevent" in my dictionary.
Alan
Tim Deegan writes ("Re: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 8 lines
Quoted 2 lines · Joseph
So how would the user (or installation SW) specify to use the best (IOMMU) security available on the platform?
iommu=on. That pretty much lines up with the current meaining.
Only iommu=force requires a fully secure IOMMU, and you can overide that with iommu=force,nointremap.
I think this is the best behaviour. Do we have a patch that implements it ? If I'm not confused, the patch further upthread crashes on lack of intremap even with iommu=on.
Ian.
Quoted 5 lines · Ian Jackson
Tim Deegan writes ("Re: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 4 lines
Quoted 2 lines · Joseph
So how would the user (or installation SW) specify to use the best (IOMMU) security available on the platform?
Quoted 8 lines
Quoted 4 lines
iommu=on. That pretty much lines up with the current meaining.
Only iommu=force requires a fully secure IOMMU, and you can overide that with iommu=force,nointremap.
I think this is the best behaviour. Do we have a patch that implements it ? If I'm not confused, the patch further upthread crashes on lack of intremap even with iommu=on.
AIUI Ian Campbell's most recent patch does exactly this. Ian?
Tim.
Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)
Quoted 8 lines · Tim Deegan
Quoted 7 lines · Ian Jackson
Tim Deegan writes ("Re: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 6 lines
Quoted 2 lines · Joseph
So how would the user (or installation SW) specify to use the best (IOMMU) security available on the platform?
iommu=on. That pretty much lines up with the current meaining.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Only iommu=force requires a fully secure IOMMU, and you can overide that with iommu=force,nointremap.
I think this is the best behaviour. Do we have a patch that implements it ? If I'm not confused, the patch further upthread crashes on lack of intremap even with iommu=on.
AIUI Ian Campbell's most recent patch does exactly this. Ian?
You mean the first one in <[email protected]>? I believe it has this effect, yes, although the iommu setup code has several places which fallback to intremap = 0 if some condition is not met e.g. "! ecap_intr_remap(iommu->ecap)" or if "Queue Invalidation" is not enabled/supported, I expect they need a similar check. Rather than sprinkling panic()s everywhere lets just pull the check for force && ! intremap out into the top level generic function.
There also seemed to be a missing "iommu_intremap = 0" in the case where enable_intremap failed in init_vtd_hw.
Ian.
8<----------------------------------------------------
# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1306141240 -3600
# Node ID aafc09d804172e3169b64e0ae8f4fc56a1a70fbb
# Parent 3db330334e3512a5326bbed4881718a63eec171a
IOMMU: Fail if intremap is not available and iommu=required/force.
Rather than sprinkling panic()s throughout the setup code hoist the check up into common code.
xen/drivers/passthrough/iommu.c +4 -1
@@ -311,6 +311,7 @@ int deassign_device(struct domain *d, u8int __init iommu_setup (void ) {int rc = -ENODEV ; +int need_intremap = iommu_intremap;if ( iommu_dom0_strict ) iommu_passthrough =0 ;
@@ -322,7 +323,9 @@ int __init iommu_setup(void) }if ( force_iommu && !iommu_enabled ) -panic ("IOMMU setup failed, crash Xen for security purpose!\n" ); +panic ("Unable to enable IOMMU and iommu=required/force\n" ); +if ( force_iommu && !iommu_intremap && need_intremap ) +panic ("Unable to enable Interrupt Remapping and iommu=required/force\n" );if ( !iommu_enabled ) {
xen/drivers/passthrough/vtd/iommu.c +1 -4
@@ -1971,8 +1971,6 @@ static int init_vtd_hw(void)"ioapic_to_iommu: ioapic 0x%x (id: 0x%x) is NULL! " "Will not try to enable Interrupt Remapping.\n" , apic, IO_APIC_ID(apic)); -if ( force_iommu ) -panic ("intremap remapping failed to enable with iommu=required/force in grub\n" );break ; } }
@@ -1984,11 +1982,10 @@ static int init_vtd_hw(void) iommu = drhd->iommu;if (enable_intremap (iommu,0 ) !=0 ) { + iommu_intremap =0 ; dprintk(XENLOG_WARNING VTDPREFIX, "Interrupt Remapping not enabled\n"); -if ( force_iommu &&platform_supports_intremap () ) -panic ("intremap remapping failed to enable with iommu=required/force in grub\n" );break ; } }
Ian Jackson
Acked-byIan Campbell writes ("Re: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 6 lines
IOMMU: Fail if intremap is not available and iommu=required/force.
Rather than sprinkling panic()s throughout the setup code hoist the check up into common code.
Signed-off-by Ian Campbell <[email protected]>
Keir, do you think we should apply this then ?
Ian.
Quoted 4 lines · Ian Jackson
Ian Campbell writes ("Re: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 2 lines
IOMMU: Fail if intremap is not available and iommu=required/force.
Quoted 8 lines
Quoted 4 lines
Rather than sprinkling panic()s throughout the setup code hoist the check up into common code.
Signed-off-by Ian Campbell <[email protected]>Acked-by Ian Jackson <[email protected]>Keir, do you think we should apply this then ?
<sigh> take your pick really. Majority opinion is on the side of this revised patch, however Intel are the primary maintainers of this code and they clearly do not like it. If I have a casting vote here, I would be inclined to plump in favour of the revised patch -- we already have iommu=on as a best-effort option, and I believe iommu=force could be stronger than it is. However Joseph's claim that the non-DoS vulns may all now be handled is not as unconvincing as some seem to believe (and I was in that camp for a while) -- I can't really see how the attack vector can be successfully exploited now my mitigation patch is in the tree. So I'm not strongly inclined one way or the other really.
-- Keir
Quoted 6 lines
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 11 lines
<sigh> take your pick really. Majority opinion is on the side of this revised patch, however Intel are the primary maintainers of this code and they clearly do not like it. If I have a casting vote here, I would be inclined to plump in favour of the revised patch -- we already have iommu=on
as a best-effort option, and I believe iommu=force could be stronger than it is. However Joseph's claim that the non-DoS vulns may all now be handled is not as unconvincing as some seem to believe (and I was in that camp for a while) -- I can't really see how the attack vector can be successfully exploited now my mitigation patch is in the tree. So I'm not strongly inclined one way or the other really.
My inclination would be such that iommu=force is allowed on non IR systems, but where IR is expected to be present e.g. sandybridge generation we insist that it is enabled (i.e. that the BIOS supports it).
Ian
Ian Pratt writes ("RE: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 4 lines
My inclination would be such that iommu=force is allowed on non IR systems, but where IR is expected to be present e.g. sandybridge generation we insist that it is enabled (i.e. that the BIOS supports it).
I don't think that's a conceptually coherent point of view, unless the purpose is to avoid marketing embarrassment.
Either IR is required for a secure system with passthrough, in which case iommu=force should require IR, or it is not required for a secure system with passthrough, in which case iommu=force should not insist on it.
Whether it is required for security doesn't depend on whether it is actually available. That there are some motherboards which cannot do passthrough securely does not mean that we should allow users of those boards to be led up the garden path.
Ian.
Quoted 10 lines
From: Ian Jackson [mailto:[email protected]]
Sent: Tuesday, May 24, 2011 10:14 AMIan Pratt writes ("RE: [Xen-devel] Xen security advisory CVE-2011-1898 - VT-d (PCI passthrough) MSI"):
Quoted 4 lines
My inclination would be such that iommu=force is allowed on non IR systems, but where IR is expected to be present e.g. sandybridge generation we insist that it is enabled (i.e. that the BIOS supports it).
Quoted 6 lines
I don't think that's a conceptually coherent point of view, unless the purpose is to avoid marketing embarrassment.
Either IR is required for a secure system with passthrough, in which case iommu=force should require IR, or it is not required for a secure system with passthrough, in which case iommu=force should not insist on it.
None of the proposed patches check for whether passthrough is being used. Nor can they check whether it is being used safely (it may be used for performance by domains that are trusted).
Whether IR is required for a secure system with passthrough depends on the usage model (as I indicated in an earlier email). The user/distributor should decide whether their usage model requires it or not. If it does, then all they need to do is run on HW that supports IR (and if they're worried about the pre-OS attack then use TXT, which would be necessary anyway).
Quoted 3 lines
Whether it is required for security doesn't depend on whether it is actually available. That there are some motherboards which cannot do passthrough securely does not mean that we should allow users of those boards to be led up the garden path.