Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753483AbbH3Mdn (ORCPT ); Sun, 30 Aug 2015 08:33:43 -0400 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:41434 "EHLO e28smtp06.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753324AbbH3Mdm (ORCPT ); Sun, 30 Aug 2015 08:33:42 -0400 X-Helo: d28dlp02.in.ibm.com X-MailFrom: aneesh.kumar@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org From: "Aneesh Kumar K.V" To: Andrey Ryabinin Cc: Benjamin Herrenschmidt , paulus@samba.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, LKML Subject: Re: [PATCH V2 02/10] kasan: MODULE_VADDR is not available on all archs In-Reply-To: References: <1440577578-15813-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1440577578-15813-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Sun, 30 Aug 2015 18:03:28 +0530 Message-ID: <87d1y5q7l3.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15083012-0021-0000-0000-00000718E162 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1732 Lines: 45 Andrey Ryabinin writes: > 2015-08-26 11:26 GMT+03:00 Aneesh Kumar K.V : >> Conditionalize the check using #ifdef >> >> Signed-off-by: Aneesh Kumar K.V >> --- >> mm/kasan/report.c | 11 ++++++++--- >> 1 file changed, 8 insertions(+), 3 deletions(-) >> >> diff --git a/mm/kasan/report.c b/mm/kasan/report.c >> index e07c94fbd0ac..71ce7548d914 100644 >> --- a/mm/kasan/report.c >> +++ b/mm/kasan/report.c >> @@ -85,9 +85,14 @@ static void print_error_description(struct kasan_access_info *info) >> >> static inline bool kernel_or_module_addr(const void *addr) >> { >> - return (addr >= (void *)_stext && addr < (void *)_end) >> - || (addr >= (void *)MODULES_VADDR >> - && addr < (void *)MODULES_END); >> + if (addr >= (void *)_stext && addr < (void *)_end) >> + return true; >> +#if defined(CONFIG_MODULES) && defined(MODULES_VADDR) >> + if (addr >= (void *)MODULES_VADDR >> + && addr < (void *)MODULES_END) >> + return true; >> +#endif > > I don't think that this is correct change. > On ppc64 modules are in VMALLOC, so you should check for this. > Yes, we don't handle VMALLOC now, but we will at some point. > > So I think we should use is_module_address() here. > It will be slower, but we don't care about performance in error reporting route. Will fix in the next update. -aneesh -- 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/