From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id 9CD7E6B0069 for ; Tue, 24 Jan 2017 05:23:24 -0500 (EST) Received: by mail-wm0-f69.google.com with SMTP id r126so25189816wmr.2 for ; Tue, 24 Jan 2017 02:23:24 -0800 (PST) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id k5si17745922wme.41.2017.01.24.02.23.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 Jan 2017 02:23:23 -0800 (PST) Date: Tue, 24 Jan 2017 11:23:19 +0100 From: Michal Hocko Subject: Re: [PATCH v2] mm: do not export ioremap_page_range symbol for external module Message-ID: <20170124102319.GD6867@dhcp22.suse.cz> References: <1485173220-29010-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1485173220-29010-1-git-send-email-zhongjiang@huawei.com> Sender: owner-linux-mm@kvack.org List-ID: To: zhongjiang Cc: akpm@linux-foundation.org, jhubbard@nvidia.com, linux-mm@kvack.org, minchan@kernel.org On Mon 23-01-17 20:07:00, zhongjiang wrote: > From: zhong jiang > > Recently, I've found cases in which ioremap_page_range was used > incorrectly, in external modules, leading to crashes. This can be > partly attributed to the fact that ioremap_page_range is lower-level, > with fewer protections, as compared to the other functions that an > external module would typically call. Those include: > > ioremap_cache > ioremap_nocache > ioremap_prot > ioremap_uc > ioremap_wc > ioremap_wt > > ...each of which wraps __ioremap_caller, which in turn provides a > safer way to achieve the mapping. > > Therefore, stop EXPORT-ing ioremap_page_range. > > Signed-off-by: zhong jiang > Reviewed-by: John Hubbard > Suggested-by: John Hubbard git grep says that there are few direct users of this API in the tree. Have you checked all of them? The export has been added by 81e88fdc432a ("ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support"). Other than that this looks reasonably to me. > --- > lib/ioremap.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/lib/ioremap.c b/lib/ioremap.c > index 86c8911..a3e14ce 100644 > --- a/lib/ioremap.c > +++ b/lib/ioremap.c > @@ -144,4 +144,3 @@ int ioremap_page_range(unsigned long addr, > > return err; > } > -EXPORT_SYMBOL_GPL(ioremap_page_range); > -- > 1.8.3.1 -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org