Skip to contentSkip to conversation

x86, UV: null pointer in uv_flush_tlb_others()

PATCH New cpw 2 participants 2 messages Dec 3, 2013 – Dec 10, 2013

Subsystems (2)
lore
Share & tools
lore

cpw

author
#0 lore raw

PATCH 1/1 x86, UV: null pointer in uv_flush_tlb_others()

The SGI UV tlb shootdown code panics the system with a null pointer deference if 'nobau' is specified on the boot commandline.

uv_flush_tlb_other() gets called for every flush, whether the BAU is disabled or not. It should not be keeping the s_enters statistic while the BAU is disabled.
The panic occurs because, during initialization, init_per_cpu_tunables() does not set the bcp->statp pointer if nobau was specified.

The code is the same in the 3.12.2 tree.

---
 arch/x86/platform/uv/tlb_uv.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/platform/uv/tlb_uv.c +3 -2
Index: linux/arch/x86/platform/uv/tlb_uv.c
===================================================================
@@ -1070,12 +1070,13 @@ const struct cpumask *uv_flush_tlb_other
 	unsigned long status;
 
 	bcp = &per_cpu(bau_control, cpu);
-	stat = bcp->statp;
-	stat->s_enters++;
 
 	if (bcp->nobau)
 		return cpumask;
 
+	stat = bcp->statp;
+	stat->s_enters++;
+
 	if (bcp->busy) {
 		descriptor_status =
 			read_lmmr(UVH_LB_BAU_SB_ACTIVATION_STATUS_0);
merge bot
#1 lore raw

[tip:x86/urgent] x86/UV: Fix NULL pointer dereference in uv_flush_tlb_others() if the 'nobau' boot option is used

x86/UV: Fix NULL pointer dereference in uv_flush_tlb_others() if the 'nobau' boot option is used
Commit-ID:  3eae49ca8954f958b2001ab5643ef302cb7b67c7
Gitweb:     http://git.kernel.org/tip/3eae49ca8954f958b2001ab5643ef302cb7b67c7
Author:     cpw <[email protected]>
AuthorDate: Tue, 3 Dec 2013 17:15:30 -0600
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 10 Dec 2013 10:06:00 +0100

x86/UV: Fix NULL pointer dereference in uv_flush_tlb_others() if the 'nobau' boot option is used

The SGI UV tlb shootdown code panics the system with a NULL pointer deference if 'nobau' is specified on the boot commandline.

uv_flush_tlb_other() gets called for every flush, whether the BAU is disabled or not. It should not be keeping the s_enters statistic while the BAU is disabled.

The panic occurs because during initialization init_per_cpu_tunables() does not set the bcp->statp pointer if 'nobau' was specified.

---
 arch/x86/platform/uv/tlb_uv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/platform/uv/tlb_uv.c +3 -2
index 0f92173..efe4d72 100644
@@ -1070,12 +1070,13 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
 	unsigned long status;
 
 	bcp = &per_cpu(bau_control, cpu);
-	stat = bcp->statp;
-	stat->s_enters++;
 
 	if (bcp->nobau)
 		return cpumask;
 
+	stat = bcp->statp;
+	stat->s_enters++;
+
 	if (bcp->busy) {
 		descriptor_status =
 			read_lmmr(UVH_LB_BAU_SB_ACTIVATION_STATUS_0);