OSDN Git Service

x86/pti: Check the return value of pti_user_pagetable_walk_pmd()
authorJiang Biao <jiang.biao2@zte.com.cn>
Fri, 20 Jul 2018 00:06:32 +0000 (08:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:39:29 +0000 (08:39 +0200)
commit19700e6c1d40365f9f55d11c0c6ba5f1116d46e8
treef06fb2b06db58120f1d6bee0dad2f9f95fc459d7
parenta9edba8f5f3cbcedd8abd2a0a2f856024ff60cce
x86/pti: Check the return value of pti_user_pagetable_walk_pmd()

[ Upstream commit 8c934e01a7ce685d98e970880f5941d79272c654 ]

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

Add the check and a warning when the PMD 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-2-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