The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: tip-bot for Mike Travis <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: akpm@linux-foundation.org, rja@sgi.com, mingo@kernel.org,
	estabrook@sgi.com, linux-kernel@vger.kernel.org,
	peterz@infradead.org, hpa@zytor.com, nzimmer@sgi.com,
	athorlton@sgi.com, abanman@sgi.com, sivanich@sgi.com,
	tglx@linutronix.de, framsay@sgi.com, travis@sgi.com,
	torvalds@linux-foundation.org
Subject: [tip:x86/urgent] x86/platform/UV: Fix bug with iounmap() of the UV4 EFI System Table causing a crash
Date: Wed, 10 Aug 2016 11:11:41 -0700	[thread overview]
Message-ID: <tip-e363d24c2b997c421476c6aa00547edadf678efe@git.kernel.org> (raw)
In-Reply-To: <20160801184050.250424783@asylum.americas.sgi.com>

Commit-ID:  e363d24c2b997c421476c6aa00547edadf678efe
Gitweb:     http://git.kernel.org/tip/e363d24c2b997c421476c6aa00547edadf678efe
Author:     Mike Travis <travis@sgi.com>
AuthorDate: Mon, 1 Aug 2016 13:40:51 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 10 Aug 2016 15:55:38 +0200

x86/platform/UV: Fix bug with iounmap() of the UV4 EFI System Table causing a crash

Save the uv_systab::size field before doing the iounmap()
of the struct pointer, to avoid a NULL dereference crash.

Tested-by: Frank Ramsay <framsay@sgi.com>
Tested-by: John Estabrook <estabrook@sgi.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Dimitri Sivanich <sivanich@sgi.com>
Reviewed-by: Nathan Zimmer <nzimmer@sgi.com>
Cc: Alex Thorlton <athorlton@sgi.com>
Cc: Andrew Banman <abanman@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russ Anderson <rja@sgi.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20160801184050.250424783@asylum.americas.sgi.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/platform/uv/bios_uv.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/platform/uv/bios_uv.c b/arch/x86/platform/uv/bios_uv.c
index 66b2166..4e9fd13 100644
--- a/arch/x86/platform/uv/bios_uv.c
+++ b/arch/x86/platform/uv/bios_uv.c
@@ -199,12 +199,14 @@ void uv_bios_init(void)
 		return;
 	}
 
+	/* Starting with UV4 the UV systab size is variable */
 	if (uv_systab->revision >= UV_SYSTAB_VERSION_UV4) {
+		int size = uv_systab->size;
+
 		iounmap(uv_systab);
-		uv_systab = ioremap(efi.uv_systab, uv_systab->size);
+		uv_systab = ioremap(efi.uv_systab, size);
 		if (!uv_systab) {
-			pr_err("UV: UVsystab: ioremap(%d) failed!\n",
-				uv_systab->size);
+			pr_err("UV: UVsystab: ioremap(%d) failed!\n", size);
 			return;
 		}
 	}

  reply	other threads:[~2016-08-10 18:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01 18:40 [PATCH 0/4] x86/platform/UV: SGI UV4 Kernel Fixes Mike Travis
2016-08-01 18:40 ` [PATCH 1/4] x86/platform/UV: Fix problem with UV4 Socket IDs not being contiguous Mike Travis
2016-08-10 18:11   ` [tip:x86/urgent] " tip-bot for Mike Travis
2016-08-01 18:40 ` [PATCH 2/4] x86/platform/UV: Fix problem with iounmap UV4 EFI System Table causing panic Mike Travis
2016-08-10 18:11   ` tip-bot for Mike Travis [this message]
2016-08-01 18:40 ` [PATCH 3/4] x86/platform/UV: Fix problem with UV4 BIOS providing incorrect PXM values Mike Travis
2016-08-10 18:12   ` [tip:x86/urgent] " tip-bot for Mike Travis
2016-08-01 18:40 ` [PATCH 4/4] x86/platform/UV: Fix kernel panic running RHEL kdump kernel on UV Mike Travis
2016-08-10 18:12   ` [tip:x86/urgent] x86/platform/UV: Fix kernel panic running RHEL kdump kernel on UV systems tip-bot for Mike Travis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-e363d24c2b997c421476c6aa00547edadf678efe@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=abanman@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=athorlton@sgi.com \
    --cc=estabrook@sgi.com \
    --cc=framsay@sgi.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=nzimmer@sgi.com \
    --cc=peterz@infradead.org \
    --cc=rja@sgi.com \
    --cc=sivanich@sgi.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=travis@sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox