]> www.infradead.org Git - users/jedix/linux-maple.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>
Tue, 29 Sep 2015 17:26:05 +0000 (19:26 +0200)
commitf5a73e9c4a1c5dc9f1d90abf782c5f9ac694e443
tree6e135d24159d8ac40019ba184325cb113a4946fe
parentb46f51da057f2a4728f8cc4e30e64e297151db76
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