]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
s390/pci: fix use after free in dma_init
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Mon, 23 May 2016 17:15:32 +0000 (11:15 -0600)
committerKamal Mostafa <kamal@canonical.com>
Fri, 10 Jun 2016 13:32:25 +0000 (06:32 -0700)
commit895db71484a8c8f29ba4db0c5e44723c0fe40be8
treeaeb3749726e5dbaa93a935f1d200abdd77d32614
parent54174a230298b42fcc32635f181529289e74d852
s390/pci: fix use after free in dma_init

BugLink: http://bugs.launchpad.net/bugs/1584828
After a failure during registration of the dma_table (because of the
function being in error state) we free its memory but don't reset the
associated pointer to zero.

When we then receive a notification from firmware (about the function
being in error state) we'll try to walk and free the dma_table again.

Fix this by resetting the dma_table pointer. In addition to that make
sure that we free the iommu_bitmap when appropriate.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit dba599091c191d209b1499511a524ad9657c0e5a)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
arch/s390/pci/pci_dma.c