Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752452AbbKQH6s (ORCPT ); Tue, 17 Nov 2015 02:58:48 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:58679 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750913AbbKQH6r (ORCPT ); Tue, 17 Nov 2015 02:58:47 -0500 X-AuditID: cbfee61a-f79a06d000005c6f-50-564ade354046 From: Shailendra Verma To: Russell King , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Riley Andrews , Laura Abbott , Jungseung Lee , Shailendra Verma , Dan Carpenter , Mitchel Humpherys , Sumit Semwal , "Kirill A. Shutemov" , Gioh Kim , Rasmus Villemoes , Shawn Lin , Markus Elfring , linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, Hillf Danton Cc: Ravikant Bijendra Sharma , Shailendra Verma , linux-kernel@vger.kernel.org, vidushi.koul@samsung.com Subject: [PATCH] arch:arm:mm:Aligning the module end and Correction in Date: Tue, 17 Nov 2015 13:26:51 +0530 Message-id: <1447747011-26930-1-git-send-email-shailendra.v@samung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHLMWRmVeSWpSXmKPExsVy+t9jQV3Te15hBi/Wyli8/3ufzeL1v+ks FnvO/GK3ON+5nNniWdMXRovmxevZLObOP8xu8XfOOyaLm8/nsFhs75zBbrHp8TVWi8u75rBZ 3L7Ma/F41jw2i7Xzt7FZNDXMZrd4vekvo8WteTPZLBZ9e8VscefJelaLU3c/Aw25eInNQcxj 4tuPLB7bdm9j9Whp7mHzuNzXy+Rxb99hFo+ds+6ye3S9vcLkcefaHjaPeScDPfbPXcPusXlJ vcfHp7dYPC50ZXv8nbWfxaNvyypGj6ZT7awBglFcNimpOZllqUX6dglcGXNufWUt2M5VsfJb N3sD4zmOLkZODgkBE4lHM/vYIGwxiQv31gPZXBxCArMYJb62v2WCcF4zSvxYsQnI4eBgEzCQ 2HQrACQuIjCdTeLS5mnsIA6zwHxGiQ/f5oCNEhZwk7jzYx2YzSKgKvFp03J2EJtXwF1i17un YIMkBBQk5kyymcDIvYCRYRWjRGpBckFxUnquYV5quV5xYm5xaV66XnJ+7iZGcKw8k9rBeHCX +yFGAQ5GJR7eHUe8woRYE8uKK3MPMUpwMCuJ8CpfBwrxpiRWVqUW5ccXleakFh9ilOZgURLn 1fc0ChMSSE8sSc1OTS1ILYLJMnFwSjUwuh6YqMz+g+3sQ9suxrbjwczFD9Uq7ObHTbgoytg3 /+LVVVslj3+7/ayy7svDndrTJObuvrhfPMaBq3/vxcZgeT6bD5+1pvdfFAt9mVifMTn7WeXL qa/atjy6uNzIcKrtV7PDwcsjnPaVyUaFS92PiBLk+/3m1lceJYFFOyQaXh8pnqMVoCxio8RS nJFoqMVcVJwIAGh9FIKRAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1538 Lines: 47 From: Shailendra Verma 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 Signed-off-by: Shailendra Verma Reviewed-by: Ravikant Bijendra Sharma --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/