]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen/pciback: Save xen_pci_op commands before processing it
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 16 Nov 2015 17:40:48 +0000 (12:40 -0500)
committerJoao Martins <joao.m.martins@oracle.com>
Sun, 27 Mar 2016 01:01:37 +0000 (02:01 +0100)
commit6019a01eb20ec89326578eab3bfa3fc28fa897e8
treeae88251aa00b75df04b2fc3a9abb238e954b4020
parent1f8ec040447f9fe74321cd277e7ab9d8cd5bdcd6
xen/pciback: Save xen_pci_op commands before processing it

Double fetch vulnerabilities that happen when a variable is
fetched twice from shared memory but a security check is only
performed the first time.

The xen_pcibk_do_op function performs a switch statements on the op->cmd
value which is stored in shared memory. Interestingly this can result
in a double fetch vulnerability depending on the performed compiler
optimization.

This patch fixes it by saving the xen_pci_op command before
processing it. We also use 'barrier' to make sure that the
compiler does not perform any optimization.

This is part of XSA155.

CC: stable@vger.kernel.org
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(cherry picked from commit 8135cf8b092723dbfcc611fe6fdcb3a36c9951c5)
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
drivers/xen/xen-pciback/pciback.h
drivers/xen/xen-pciback/pciback_ops.c