]> git.ipfire.org Git - people/ms/linux.git/commit
powerpc/mm: Recompute hash value after a failed update
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tue, 15 Sep 2015 07:00:08 +0000 (12:30 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2015 09:36:10 +0000 (11:36 +0200)
commit5d395c5df33ca77b6da7e36a1f971bdcc580ec4a
tree021685c5dee3dd58780d02626a04a20f8a17e4e9
parent4d14a9e6fb8bc461bc62a4289bd4bbca7cd610b3
powerpc/mm: Recompute hash value after a failed update

commit 36b35d5d807b7e57aff7d08e63de8b17731ee211 upstream.

If we had secondary hash flag set, we ended up modifying hash value in
the updatepp code path. Hence with a failed updatepp we will be using
a wrong hash value for the following hash insert. Fix this by
recomputing hash before insert.

Without this patch we can end up with using wrong slot number in linux
pte. That can result in us missing an hash pte update or invalidate
which can cause memory corruption or even machine check.

Fixes: 6d492ecc6489 ("powerpc/THP: Add code to handle HPTE faults for hugepages")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/mm/hugepage-hash64.c