stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "um: Fix kernel mode fault condition" has been added to the 4.2-stable tree
@ 2015-11-06  6:58 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-11-06  6:58 UTC (permalink / raw)
  To: richard, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    um: Fix kernel mode fault condition

to the 4.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     um-fix-kernel-mode-fault-condition.patch
and it can be found in the queue-4.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 56b88a3bf97a39d3f4f010509917b76a865a6dc8 Mon Sep 17 00:00:00 2001
From: Richard Weinberger <richard@nod.at>
Date: Sun, 9 Aug 2015 22:26:33 +0200
Subject: um: Fix kernel mode fault condition

From: Richard Weinberger <richard@nod.at>

commit 56b88a3bf97a39d3f4f010509917b76a865a6dc8 upstream.

We have to exclude memory locations <= PAGE_SIZE from
the condition and let the kernel mode fault path catch it.
Otherwise a kernel NULL pointer exception will be reported
as a kernel user space access.

Fixes: d2313084e2c (um: Catch unprotected user memory access)
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/um/kernel/trap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/um/kernel/trap.c
+++ b/arch/um/kernel/trap.c
@@ -220,7 +220,7 @@ unsigned long segv(struct faultinfo fi,
 		show_regs(container_of(regs, struct pt_regs, regs));
 		panic("Segfault with no mm");
 	}
-	else if (!is_user && address < TASK_SIZE) {
+	else if (!is_user && address > PAGE_SIZE && address < TASK_SIZE) {
 		show_regs(container_of(regs, struct pt_regs, regs));
 		panic("Kernel tried to access user memory at addr 0x%lx, ip 0x%lx",
 		       address, ip);


Patches currently in stable-queue which might be from richard@nod.at are

queue-4.2/um-fix-kernel-mode-fault-condition.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-06  6:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-06  6:58 Patch "um: Fix kernel mode fault condition" has been added to the 4.2-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).