]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/pti: Check the return value of pti_user_pagetable_walk_p4d()
authorJiang Biao <jiang.biao2@zte.com.cn>
Fri, 20 Jul 2018 00:06:31 +0000 (08:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:38:05 +0000 (08:38 +0200)
commit36d6a43a16e5ee79917ae58b85d5df8283483c1d
treee485b7c80cfaa93c339a90d10b614eaf52c8660c
parentef275ba514d97398a5a78bd23929663396872c58
x86/pti: Check the return value of pti_user_pagetable_walk_p4d()

[ Upstream commit b2b7d986a89b6c94b1331a909de1217214fb08c1 ]

pti_user_pagetable_walk_p4d() can return NULL, so the return value should
be checked to prevent a NULL pointer dereference.

Add the check and a warning when the P4D allocation fails.

Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: dave.hansen@linux.intel.com
Cc: luto@kernel.org
Cc: hpa@zytor.com
Cc: albcamus@gmail.com
Cc: zhong.weidong@zte.com.cn
Link: https://lkml.kernel.org/r/1532045192-49622-1-git-send-email-jiang.biao2@zte.com.cn
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/mm/pti.c