Patch "cxl: Fix off by one error allowing subsequent mmap page to be accessed" has been added to the 4.1-stable tree
Subsystems (2)
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 <[email protected]> know about it.
Quoted 1 line
From
10a5894f2dedd8a26b3132497445b314c0d952c4Mon Sep 17 00:00:00 2001
From: Ian Munsie <[email protected]>
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 <[email protected]>
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.
--- drivers/misc/cxl/context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/cxl/context.c +2 -2
@@ -113,11 +113,11 @@ static int cxl_mmap_fault(struct vm_areaif (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 [email protected] 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