PCI: aardvark: Don't rely on jiffies while holding spinlock
stable inclusion from stable-v4.19.198 commit 6571c80330ac43f2487403f04efcdbbcf796cf7b category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9R4IP CVE: CVE-2021-47229 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6571c80330ac43f2487403f04efcdbbcf796cf7b --------------------------- commit 7fbcb5da upstream. advk_pcie_wait_pio() can be called while holding a spinlock (from pci_bus_read_config_dword()), then depends on jiffies in order to timeout while polling on PIO state registers. In the case the PIO transaction failed, the timeout will never happen and will also cause the cpu to stall. This decrements a variable and wait instead of using jiffies. Signed-off-by:Remi Pommarel <repk@triplefau.lt> Signed-off-by:
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by:
Andrew Murray <andrew.murray@arm.com> Acked-by:
Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Zeng Heng <zengheng4@huawei.com>
Loading
Please sign in to comment