Skip to contentSkip to conversation

powerpc/tm: Fix null pointer deference in flush_hash_page

PATCH New Michael Neuling 1 participant 1 message May 3, 2013 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/tm: Fix null pointer deference in flush_hash_page

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

arch/powerpc/mm/hash_utils_64.c +1 -0
index 3e4c4ed..88ac0ee 100644
@@ -1230,6 +1230,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);