stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "cxl: Fix off by one error allowing subsequent mmap page to be accessed" has been added to the 4.1-stable tree
@ 2015-08-06 23:29 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-08-06 23:29 UTC (permalink / raw)
  To: imunsie, gregkh, mpe; +Cc: stable, stable-commits


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

    cxl: Fix off by one error allowing subsequent mmap page to be accessed

to the 4.1-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:
     cxl-fix-off-by-one-error-allowing-subsequent-mmap-page-to-be-accessed.patch
and it can be found in the queue-4.1 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 10a5894f2dedd8a26b3132497445b314c0d952c4 Mon Sep 17 00:00:00 2001
From: Ian Munsie <imunsie@au1.ibm.com>
Date: Tue, 7 Jul 2015 15:45:45 +1000
Subject: cxl: Fix off by one error allowing subsequent mmap page to be accessed

From: Ian Munsie <imunsie@au1.ibm.com>

commit 10a5894f2dedd8a26b3132497445b314c0d952c4 upstream.

It was discovered that if a process mmaped their problem state area they
were able to access one page more than expected, potentially allowing
them to access the problem state area of an unrelated process.

This was due to a simple off by one error in the mmap fault handler
introduced in 0712dc7e73e59d79bcead5d5520acf4e9e917e87 ("cxl: Fix issues
when unmapping contexts"), which is fixed in this patch.

Fixes: 0712dc7e73e5 ("cxl: Fix issues when unmapping contexts")
Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/misc/cxl/context.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/misc/cxl/context.c
+++ b/drivers/misc/cxl/context.c
@@ -113,11 +113,11 @@ static int cxl_mmap_fault(struct vm_area
 
 	if (ctx->afu->current_mode == CXL_MODE_DEDICATED) {
 		area = ctx->afu->psn_phys;
-		if (offset > ctx->afu->adapter->ps_size)
+		if (offset >= ctx->afu->adapter->ps_size)
 			return VM_FAULT_SIGBUS;
 	} else {
 		area = ctx->psn_phys;
-		if (offset > ctx->psn_size)
+		if (offset >= ctx->psn_size)
 			return VM_FAULT_SIGBUS;
 	}
 


Patches currently in stable-queue which might be from imunsie@au1.ibm.com are

queue-4.1/cxl-check-if-afu-is-not-null-in-cxl_slbia.patch
queue-4.1/cxl-fix-off-by-one-error-allowing-subsequent-mmap-page-to-be-accessed.patch

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

only message in thread, other threads:[~2015-08-06 23:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-06 23:29 Patch "cxl: Fix off by one error allowing subsequent mmap page to be accessed" has been added to the 4.1-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).