]> git.baikalelectronics.ru Git - kernel.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)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 16 Sep 2015 12:06:03 +0000 (22:06 +1000)
commit6b0acc025a3e7f927ef22dfbc0ba7bd6bcc94959
tree1629b6259078a9ef2b0e6eaeeee930a0fb456e57
parent2176c057afaba50df2ce43e0aec0135116d3d187
powerpc/mm: Recompute hash value after a failed update

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: 4e42ab7a839c ("powerpc/THP: Add code to handle HPTE faults for hugepages")
Cc: stable@vger.kernel.org # v3.11+
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>
arch/powerpc/mm/hugepage-hash64.c