]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
virtio_balloon: prevent pfn array overflow
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 6 Feb 2020 07:40:58 +0000 (02:40 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 7 Apr 2020 08:50:26 +0000 (10:50 +0200)
commitaeb45d8da895efb635dc5824ded398972a3bcba8
tree54c2a25d417bc26958416cf81dd7f935addf53af
parent1121a2ec6b98efc6315f39c37999e00d70683fa7
virtio_balloon: prevent pfn array overflow

BugLink: https://bugs.launchpad.net/bugs/1867837
[ Upstream commit 6e9826e77249355c09db6ba41cd3f84e89f4b614 ]

Make sure, at build time, that pfn array is big enough to hold a single
page.  It happens to be true since the PAGE_SHIFT value at the moment is
20, which is 1M - exactly 256 4K balloon pages.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/virtio/virtio_balloon.c