]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: Bounds-check command-line resource alignment requests
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 5 Nov 2020 20:51:36 +0000 (14:51 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:25:58 +0000 (11:25 +0100)
commit6d7483c6434f1da19b0140bd4d62c7e18a26ffa6
tree16ca28d9bae80100cabf6d111d21fe6d20ffa843
parent4763ddb834462097ff818a8dcae2c545c0d5ba1a
PCI: Bounds-check command-line resource alignment requests

[ Upstream commit 6534aac198b58309ff2337981d3f893e0be1d19d ]

32-bit BARs are limited to 2GB size (2^31).  By extension, I assume 64-bit
BARs are limited to 2^63 bytes.  Limit the alignment requested by the
"pci=resource_alignment=" command-line parameter to 2^63.

Link: https://lore.kernel.org/r/20201007123045.GS4282@kadam
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/pci.c