lkml.org 
[lkml]   [2015]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] arch:arm:mm:Aligning the module end and Correction in
Date
From: Shailendra Verma <Shailendra.v@samsung.com>

The module end was not aligned as of module start and boundary
check for module end is not proper.This out of bound value of
module end can produce undesired results.

Reported-by: Hillf Danton <hillf.zj@alibaba-inc.com>
Signed-off-by: Shailendra Verma <Shailendra.v@samsung.com>
Reviewed-by: Ravikant Bijendra Sharma <ravikant.s2@samsung.com>
---
linux-4.3-rc6/arch/arm/mm/pageattr.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/linux-4.3-rc6/arch/arm/mm/pageattr.c b/linux-4.3-rc6/arch/arm/mm/pageattr.c
index cf30daf..17f103c 100644
--- a/linux-4.3-rc6/arch/arm/mm/pageattr.c
+++ b/linux-4.3-rc6/arch/arm/mm/pageattr.c
@@ -43,16 +43,15 @@ static int change_memory_common(unsigned long addr, int numpages,
int ret;
struct page_change_data data;

- if (!IS_ALIGNED(addr, PAGE_SIZE)) {
- start &= PAGE_MASK;
- end = start + size;
- WARN_ON_ONCE(1);
- }
+ if (WARN_ON_ONCE(!IS_ALIGNED(addr, PAGE_SIZE))) {
+ start &= PAGE_MASK;
+ end = PAGE_ALIGN(end);
+ }

if (start < MODULES_VADDR || start >= MODULES_END)
return -EINVAL;

- if (end < MODULES_VADDR || start >= MODULES_END)
+ if (end < MODULES_VADDR || end >= MODULES_END)
return -EINVAL;

data.set_mask = set_mask;
--
1.7.9.5


\
 
 \ /
  Last update: 2015-11-17 09:21    [W:0.137 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site