* [PATCH 1/2] xen/pciback: Don't disable PCI_COMMAND on PCI device reset.
2015-04-03 14:28 [PATCH] XSA120 follows to the Linux kernel Konrad Rzeszutek Wilk
@ 2015-04-03 14:28 ` Konrad Rzeszutek Wilk
2015-04-03 14:28 ` Konrad Rzeszutek Wilk
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-04-03 14:28 UTC (permalink / raw)
To: linux-kernel, xen-devel, david.vrabel, boris.ostrovsky
Cc: Konrad Rzeszutek Wilk, stable
There is no need for this at all. Worst it means that if
the guest tries to write to BARs it could lead (on certain
platforms) to PCI SERR errors.
Please note that with af6fc858a35b90e89ea7a7ee58e66628c55c776b
"xen-pciback: limit guest control of command register"
a guest is still allowed to enable those control bits (safely), but
is not allowed to disable them and that therefore a well behaved
frontend which enables things before using them will still
function correctly.
This is done via an write to the configuration register 0x4 which
triggers on the backend side:
command_write
\- pci_enable_device
\- pci_enable_device_flags
\- do_pci_enable_device
\- pcibios_enable_device
\-pci_enable_resourcess
[which enables the PCI_COMMAND_MEMORY|PCI_COMMAND_IO]
However guests (and drivers) which don't do this could cause
problems, including the security issues which XSA-120 sought
to address.
CC: stable@vger.kernel.org
Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/xen/xen-pciback/pciback_ops.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index c4a0666..26e6513 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -119,8 +119,6 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
if (pci_is_enabled(dev))
pci_disable_device(dev);
- pci_write_config_word(dev, PCI_COMMAND, 0);
-
dev->is_busmaster = 0;
} else {
pci_read_config_word(dev, PCI_COMMAND, &cmd);
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 1/2] xen/pciback: Don't disable PCI_COMMAND on PCI device reset.
2015-04-03 14:28 [PATCH] XSA120 follows to the Linux kernel Konrad Rzeszutek Wilk
2015-04-03 14:28 ` [PATCH 1/2] xen/pciback: Don't disable PCI_COMMAND on PCI device reset Konrad Rzeszutek Wilk
@ 2015-04-03 14:28 ` Konrad Rzeszutek Wilk
2015-04-03 14:28 ` [PATCH 2/2] xen/pciback: Remove is_busmaster=0 as pci_disable_device does it already Konrad Rzeszutek Wilk
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-04-03 14:28 UTC (permalink / raw)
To: linux-kernel, xen-devel, david.vrabel, boris.ostrovsky
Cc: stable, Konrad Rzeszutek Wilk
There is no need for this at all. Worst it means that if
the guest tries to write to BARs it could lead (on certain
platforms) to PCI SERR errors.
Please note that with af6fc858a35b90e89ea7a7ee58e66628c55c776b
"xen-pciback: limit guest control of command register"
a guest is still allowed to enable those control bits (safely), but
is not allowed to disable them and that therefore a well behaved
frontend which enables things before using them will still
function correctly.
This is done via an write to the configuration register 0x4 which
triggers on the backend side:
command_write
\- pci_enable_device
\- pci_enable_device_flags
\- do_pci_enable_device
\- pcibios_enable_device
\-pci_enable_resourcess
[which enables the PCI_COMMAND_MEMORY|PCI_COMMAND_IO]
However guests (and drivers) which don't do this could cause
problems, including the security issues which XSA-120 sought
to address.
CC: stable@vger.kernel.org
Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/xen/xen-pciback/pciback_ops.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index c4a0666..26e6513 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -119,8 +119,6 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
if (pci_is_enabled(dev))
pci_disable_device(dev);
- pci_write_config_word(dev, PCI_COMMAND, 0);
-
dev->is_busmaster = 0;
} else {
pci_read_config_word(dev, PCI_COMMAND, &cmd);
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] xen/pciback: Remove is_busmaster=0 as pci_disable_device does it already
2015-04-03 14:28 [PATCH] XSA120 follows to the Linux kernel Konrad Rzeszutek Wilk
2015-04-03 14:28 ` [PATCH 1/2] xen/pciback: Don't disable PCI_COMMAND on PCI device reset Konrad Rzeszutek Wilk
2015-04-03 14:28 ` Konrad Rzeszutek Wilk
@ 2015-04-03 14:28 ` Konrad Rzeszutek Wilk
2015-04-03 14:28 ` Konrad Rzeszutek Wilk
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-04-03 14:28 UTC (permalink / raw)
To: linux-kernel, xen-devel, david.vrabel, boris.ostrovsky
Cc: Konrad Rzeszutek Wilk
There is no need for this.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/xen/xen-pciback/pciback_ops.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index 26e6513..a131733 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -118,8 +118,6 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
#endif
if (pci_is_enabled(dev))
pci_disable_device(dev);
-
- dev->is_busmaster = 0;
} else {
pci_read_config_word(dev, PCI_COMMAND, &cmd);
if (cmd & (PCI_COMMAND_INVALIDATE)) {
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] xen/pciback: Remove is_busmaster=0 as pci_disable_device does it already
2015-04-03 14:28 [PATCH] XSA120 follows to the Linux kernel Konrad Rzeszutek Wilk
` (2 preceding siblings ...)
2015-04-03 14:28 ` [PATCH 2/2] xen/pciback: Remove is_busmaster=0 as pci_disable_device does it already Konrad Rzeszutek Wilk
@ 2015-04-03 14:28 ` Konrad Rzeszutek Wilk
2015-04-10 14:37 ` [PATCH] XSA120 follows to the Linux kernel David Vrabel
2015-04-10 14:37 ` [Xen-devel] " David Vrabel
5 siblings, 0 replies; 9+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-04-03 14:28 UTC (permalink / raw)
To: linux-kernel, xen-devel, david.vrabel, boris.ostrovsky
Cc: Konrad Rzeszutek Wilk
There is no need for this.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/xen/xen-pciback/pciback_ops.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index 26e6513..a131733 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -118,8 +118,6 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
#endif
if (pci_is_enabled(dev))
pci_disable_device(dev);
-
- dev->is_busmaster = 0;
} else {
pci_read_config_word(dev, PCI_COMMAND, &cmd);
if (cmd & (PCI_COMMAND_INVALIDATE)) {
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] XSA120 follows to the Linux kernel.
2015-04-03 14:28 [PATCH] XSA120 follows to the Linux kernel Konrad Rzeszutek Wilk
` (3 preceding siblings ...)
2015-04-03 14:28 ` Konrad Rzeszutek Wilk
@ 2015-04-10 14:37 ` David Vrabel
2015-04-10 14:37 ` [Xen-devel] " David Vrabel
5 siblings, 0 replies; 9+ messages in thread
From: David Vrabel @ 2015-04-10 14:37 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk, linux-kernel, xen-devel, david.vrabel,
boris.ostrovsky
On 03/04/15 15:28, Konrad Rzeszutek Wilk wrote:
> Hey David and Boris,
>
> Please see the two patches - the first one fixes an situation that
> the original XSA-120 patch hadn't considered.
>
> The second patch is more of just a cleanup. Can be 4.1 material.
Applied both to devel/for-linus-4.1 since 4.0 is imminent (possibly),
thanks.
David
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xen-devel] [PATCH] XSA120 follows to the Linux kernel.
2015-04-03 14:28 [PATCH] XSA120 follows to the Linux kernel Konrad Rzeszutek Wilk
` (4 preceding siblings ...)
2015-04-10 14:37 ` [PATCH] XSA120 follows to the Linux kernel David Vrabel
@ 2015-04-10 14:37 ` David Vrabel
2015-04-14 8:45 ` Jan Beulich
2015-04-14 8:45 ` [Xen-devel] " Jan Beulich
5 siblings, 2 replies; 9+ messages in thread
From: David Vrabel @ 2015-04-10 14:37 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk, linux-kernel, xen-devel, david.vrabel,
boris.ostrovsky
On 03/04/15 15:28, Konrad Rzeszutek Wilk wrote:
> Hey David and Boris,
>
> Please see the two patches - the first one fixes an situation that
> the original XSA-120 patch hadn't considered.
>
> The second patch is more of just a cleanup. Can be 4.1 material.
Applied both to devel/for-linus-4.1 since 4.0 is imminent (possibly),
thanks.
David
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] XSA120 follows to the Linux kernel.
2015-04-10 14:37 ` [Xen-devel] " David Vrabel
@ 2015-04-14 8:45 ` Jan Beulich
2015-04-14 8:45 ` [Xen-devel] " Jan Beulich
1 sibling, 0 replies; 9+ messages in thread
From: Jan Beulich @ 2015-04-14 8:45 UTC (permalink / raw)
To: david.vrabel, Konrad Rzeszutek Wilk
Cc: xen-devel, boris.ostrovsky, linux-kernel
>>> On 10.04.15 at 16:37, <david.vrabel@citrix.com> wrote:
> On 03/04/15 15:28, Konrad Rzeszutek Wilk wrote:
>> Hey David and Boris,
>>
>> Please see the two patches - the first one fixes an situation that
>> the original XSA-120 patch hadn't considered.
>>
>> The second patch is more of just a cleanup. Can be 4.1 material.
>
> Applied both to devel/for-linus-4.1 since 4.0 is imminent (possibly),
> thanks.
And considering Sander's bisection result posted yesterday (plus
the - afaict - still unaddressed question raised by IanC regarding
the correctness wrt to bits other than 0 and 1) I suppose you
dropped them again?
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Xen-devel] [PATCH] XSA120 follows to the Linux kernel.
2015-04-10 14:37 ` [Xen-devel] " David Vrabel
2015-04-14 8:45 ` Jan Beulich
@ 2015-04-14 8:45 ` Jan Beulich
1 sibling, 0 replies; 9+ messages in thread
From: Jan Beulich @ 2015-04-14 8:45 UTC (permalink / raw)
To: david.vrabel, Konrad Rzeszutek Wilk
Cc: xen-devel, boris.ostrovsky, linux-kernel
>>> On 10.04.15 at 16:37, <david.vrabel@citrix.com> wrote:
> On 03/04/15 15:28, Konrad Rzeszutek Wilk wrote:
>> Hey David and Boris,
>>
>> Please see the two patches - the first one fixes an situation that
>> the original XSA-120 patch hadn't considered.
>>
>> The second patch is more of just a cleanup. Can be 4.1 material.
>
> Applied both to devel/for-linus-4.1 since 4.0 is imminent (possibly),
> thanks.
And considering Sander's bisection result posted yesterday (plus
the - afaict - still unaddressed question raised by IanC regarding
the correctness wrt to bits other than 0 and 1) I suppose you
dropped them again?
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread