]> git.hungrycats.org Git - linux/commitdiff
powerpc/tm: Fix null pointer deference in flush_hash_page
authorMichael Neuling <mikey@neuling.org>
Thu, 2 May 2013 15:36:14 +0000 (15:36 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 May 2013 14:18:16 +0000 (07:18 -0700)
commit c2fd22df89365df9451d5b91da3b7bfd48122ecd upstream.

Make sure that current->thread.reg exists before we deference it in
flush_hash_page.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Reported-by: John J Miller <millerjo@us.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/mm/hash_utils_64.c

index f410c3e12c1e78c0a6c5e24ad9f41d86fdf01337..b75c52ff42cd9b12bba60410ad43bc30011a3691 100644 (file)
@@ -1191,6 +1191,7 @@ void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize, int ssize,
         * unmapping it first, it may see the speculated version.
         */
        if (local && cpu_has_feature(CPU_FTR_TM) &&
+           current->thread.regs &&
            MSR_TM_ACTIVE(current->thread.regs->msr)) {
                tm_enable();
                tm_abort(TM_CAUSE_TLBI);