]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: endpoint: Fix for concurrent memory allocation in OB address region
authorKishon Vijay Abraham I <kishon@ti.com>
Mon, 24 Feb 2020 09:53:36 +0000 (15:23 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:12:02 +0000 (16:12 +0200)
commit0f69d6c0756c12680ad54dc887829931645f3e9a
tree9d565ecf22e98e5fa8584f3c578c630b0bb4bd6e
parent5e4059e930909e9287bde57fd200f74cdc9105ea
PCI: endpoint: Fix for concurrent memory allocation in OB address region

commit 04e046ca57ebed3943422dee10eec9e73aec081e upstream.

pci-epc-mem uses a bitmap to manage the Endpoint outbound (OB) address
region. This address region will be shared by multiple endpoint
functions (in the case of multi function endpoint) and it has to be
protected from concurrent access to avoid updating an inconsistent state.

Use a mutex to protect bitmap updates to prevent the memory
allocation API from returning incorrect addresses.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/endpoint/pci-epc-mem.c
include/linux/pci-epc.h