[<prev] [next>] [day] [month] [year] [list]
Message-id: <1478771734-1464-1-git-send-email-shailendra.v@samung.com>
Date: Thu, 10 Nov 2016 15:25:34 +0530
From: Shailendra Verma <shailendra.v@...ung.com>
To: Russell King <linux@....linux.org.uk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arve Hjønnevåg <arve@...roid.com>,
Riley Andrews <riandrews@...roid.com>,
Laura Abbott <lauraa@...eaurora.org>,
Jungseung Lee <js07.lee@...il.com>,
Shailendra Verma <shailendra.capricorn@...il.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Mitchel Humpherys <mitchelh@...eaurora.org>,
Sumit Semwal <sumit.semwal@...aro.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Gioh Kim <gioh.kim@....com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Shawn Lin <shawn.lin@...k-chips.com>,
Markus Elfring <elfring@...rs.sourceforge.net>,
linux-arm-kernel@...ts.infradead.org, devel@...verdev.osuosl.org
Cc: Shailendra Verma <shailendra.v@...sung.com>,
linux-kernel@...r.kernel.org, vidushi.koul@...sung.com
Subject: [PATCH] Arch: arm: mm: Aligning the module end and Correction in
From: "Shailendra Verma" <shailendra.v@...sung.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@...baba-inc.com>
Signed-off-by: Shailendra Verma <Shailendra.v@...sung.com>
---
arch/arm/mm/pageattr.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mm/pageattr.c b/arch/arm/mm/pageattr.c
index d19b1ad..dd0b8a2 100644
--- a/arch/arm/mm/pageattr.c
+++ b/arch/arm/mm/pageattr.c
@@ -43,10 +43,9 @@ static int change_memory_common(unsigned long addr, int numpages,
int ret;
struct page_change_data data;
- if (!IS_ALIGNED(addr, PAGE_SIZE)) {
+ if (WARN_ON_ONCE(!IS_ALIGNED(addr, PAGE_SIZE))) {
start &= PAGE_MASK;
- end = start + size;
- WARN_ON_ONCE(1);
+ end = PAGE_ALIGN(end);
}
if (!numpages)
@@ -55,7 +54,7 @@ static int change_memory_common(unsigned long addr, int numpages,
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
Powered by blists - more mailing lists