arm64: hibernate: check pgd table allocation
authorPavel Tatashin <pasha.tatashin@soleen.com>
Mon, 14 Oct 2019 14:48:24 +0000 (10:48 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:51:19 +0000 (14:51 +0100)
commit963938f507d978731e8b9f4794a5c139b2725bbb
tree1c76bffa92493a298bc314a8411972892d776980
parentb79d380017d1d23b1b07c860a1adc1360a1fcb09
arm64: hibernate: check pgd table allocation

[ Upstream commit 8c551f919a73c1dfa690a70a691be1da394145e8 ]

There is a bug in create_safe_exec_page(), when page table is allocated
it is not checked that table is allocated successfully:

But it is dereferenced in: pgd_none(READ_ONCE(*pgdp)).  Check that
allocation was successful.

Fixes: 82869ac57b5d ("arm64: kernel: Add support for hibernate/suspend-to-disk")
Reviewed-by: James Morse <james.morse@arm.com>
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/kernel/hibernate.c