Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1094275ybl; Wed, 14 Aug 2019 10:36:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqz30oe9D0orJKICCc6HdZS0z42M4XEJxb8WUHYr8SlrHLWuPgeiQ4jiNd+BOQ/rPTtkRyIO X-Received: by 2002:a63:c246:: with SMTP id l6mr302274pgg.210.1565804177452; Wed, 14 Aug 2019 10:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565804177; cv=none; d=google.com; s=arc-20160816; b=IMDWRjsni/v/qAzNt2E2IlsRGe6HQyffC8iI9tXlZ7crFgvgeBO+camIu4dvn8UCnh RiRGw+tE7+2i9PUGbd59eYhRLVkZrB8x+i6s+cHE2UfcHMcE96+ro/J2U80vR2pMShY0 G6EaHtziUSAghNLeMbaOD3Ek/jVnaYpalcNQF+TjZkvNSWGF5vSl4w/NCPymVKhhsbsy yWXW+hKfR7XKcU3cIGQL29B0BRWOWCbt5cR79rK5sJPFAHMQuS16mY4yIbzdscIiPldD atIw8Tf4b2Y6ijwHNl2Ed41wb+b62OGQtbPV5hvLPEKOrgZMTpxkdqwebYipR9Xg9U4E Ybvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fOFmALBZr12NwAFqPH4bz0Snzh0MYv/4Oy/ALTRaZDA=; b=GYPGnsztDbTH10WfI1XCpHCQfd1m06FM5kiEodCCFg8CKE/aR7rTwCwhV69yvOmAcd jC0LoLN7OaINc4din8UrZQlyZ1L9lFBF3dzffcOHzrN7Z+7Tz/cVfMYwKkuO/OuVy5BO MMsynC2X7Zqj4NyvKjMvtSdpSUNFQJ8GK+bxW8iw2LWtewwTjJth2mVpmW/mEYMltsr8 gbvzOXabhbVh9xDx1IJtysoyBbHIAUy8L4leQiNH4G1bOMkrwPfNFei/8GrLq3Nk4h6+ P4ocZhrvJk8wgzp/la7/gGyBL2Kc3bbDIMtGigDec5k2vhr1Hj9vRk2tNZfDTWngMK1C oxzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="J/RX89Sf"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b62si227768pgc.148.2019.08.14.10.35.59; Wed, 14 Aug 2019 10:36:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="J/RX89Sf"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728511AbfHNRfW (ORCPT + 99 others); Wed, 14 Aug 2019 13:35:22 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:40694 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728128AbfHNRfV (ORCPT ); Wed, 14 Aug 2019 13:35:21 -0400 Received: by mail-ot1-f66.google.com with SMTP id c34so44302385otb.7 for ; Wed, 14 Aug 2019 10:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fOFmALBZr12NwAFqPH4bz0Snzh0MYv/4Oy/ALTRaZDA=; b=J/RX89SfeoHR3tNRvGakoeZptZJRFt1aGCoCGLanpgjt6kzr4VpQHXuOeq/XIub7h3 dtaz/Elri9LmCCrz1cJasmWNTs/t3B2DIMrEzFtcDd5S3T5Z7qW0x6VQtzyPUT8xX0Dr tpBoGVGOFhjt5t/gsPYut79dUKJV/zOUYBE0KuVDsrJAB63xmL9rkN5sW1B/mX17RfT8 s7uhch2pStQ0Q6kOmXjpTKpW17nIDOPnBvNsIuNp6/qFxNyKoezYoApT9paR+P+AAJP+ 1YlKwUJfVlXI0OJvPm/r92hOejmHZfRewJNJIhMYRbj46Pt2aVShyKZOOJ23qQt+gnU7 ycMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fOFmALBZr12NwAFqPH4bz0Snzh0MYv/4Oy/ALTRaZDA=; b=rgaMUP9K35WEsPcR9RBec7T6TbGr1zzCqcn637I8CLrK1F9D+NFtzYibj5ekc7Uv+4 OkNyc32jmkh306pWfavqsWRK7Y26eacOnpdeHKspHMGH4pKZoomgFWyzrMkEpB7c5SAr 2mrHHuzSh+7FTqPgqSFDP1VAs62SnxpxUNZKvPD+k5p50RzdKcwktdAl8XQWg2gyLy/x cc6jMRfJXE/jHUzb/MjsF1g9RESMCQiRoXjf32i5amB8DyFJ+LpsDBqh0LX+S3iI93Bd Kouqt89N+MfHuLZkv/wPo9nzjUPjyK4QAsnXI4A3EiGXRA9mUTyzTON4t854yNWz7ZRV 8FTg== X-Gm-Message-State: APjAAAUptoQFdFD/vU9t+jJTcwYsQ/OWHfeMtTXoEaZFPm87itxuUn87 xbizE+aKGK3IwQIweCQIxsPmaX0FgV9/bQ7Ra3Cgtw== X-Received: by 2002:a05:6830:1e0f:: with SMTP id s15mr177324otr.231.1565804120275; Wed, 14 Aug 2019 10:35:20 -0700 (PDT) MIME-Version: 1.0 References: <20180716122125.175792-1-maco@android.com> <20190813121733.52480-1-maennich@google.com> <20190813121733.52480-6-maennich@google.com> <20190814125427.GA72826@google.com> In-Reply-To: <20190814125427.GA72826@google.com> From: Saravana Kannan Date: Wed, 14 Aug 2019 10:34:43 -0700 Message-ID: Subject: Re: [PATCH v2 05/10] module: add config option MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS To: Matthias Maennich Cc: LKML , maco@android.com, Android Kernel Team , arnd@arndb.de, geert@linux-m68k.org, Greg Kroah-Hartman , hpa@zytor.com, jeyu@kernel.org, "Joel Fernandes (Google)" , Kate Stewart , linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-modules@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, lucas.de.marchi@gmail.com, Martijn Coenen , michal.lkml@markovi.net, mingo@redhat.com, oneukum@suse.com, Philippe Ombredanne , sam@ravnborg.org, Sandeep Patil , stern@rowland.harvard.edu, tglx@linutronix.de, usb-storage@lists.one-eyed-alien.net, x86@kernel.org, yamada.masahiro@socionext.com, Andrew Morton , Johannes Weiner , "Peter Zijlstra (Intel)" , Mauro Carvalho Chehab , David Howells , Patrick Bellasi , Dan Williams , Adrian Reber , Richard Guy Briggs Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 14, 2019 at 5:54 AM 'Matthias Maennich' via kernel-team wrote: > > On Tue, Aug 13, 2019 at 01:15:44PM -0700, Saravana Kannan wrote: > >On Tue, Aug 13, 2019 at 5:19 AM 'Matthias Maennich' via kernel-team > > wrote: > >> > >> If MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is enabled (default=n), the > >> requirement for modules to import all namespaces that are used by > >> the module is relaxed. > >> > >> Enabling this option effectively allows (invalid) modules to be loaded > >> while only a warning is emitted. > >> > >> Disabling this option keeps the enforcement at module loading time and > >> loading is denied if the module's imports are not satisfactory. > >> > >> Reviewed-by: Martijn Coenen > >> Signed-off-by: Matthias Maennich > >> --- > >> init/Kconfig | 14 ++++++++++++++ > >> kernel/module.c | 11 +++++++++-- > >> 2 files changed, 23 insertions(+), 2 deletions(-) > >> > >> diff --git a/init/Kconfig b/init/Kconfig > >> index bd7d650d4a99..b3373334cdf1 100644 > >> --- a/init/Kconfig > >> +++ b/init/Kconfig > >> @@ -2119,6 +2119,20 @@ config MODULE_COMPRESS_XZ > >> > >> endchoice > >> > >> +config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS > >> + bool "Allow loading of modules with missing namespace imports" > >> + default n > >> + help > >> + Symbols exported with EXPORT_SYMBOL_NS*() are considered exported in > >> + a namespace. A module that makes use of a symbol exported with such a > >> + namespace is required to import the namespace via MODULE_IMPORT_NS(). > >> + This option relaxes this requirement when loading a module. > > > >> While > >> + technically there is no reason to enforce correct namespace imports, > >> + it creates consistency between symbols defining namespaces and users > >> + importing namespaces they make use of. > > > >I'm confused by this sentence. It sounds like it's the opposite of > >what the config is doing? Can you please reword it for clarify? > > How about: > > Symbols exported with EXPORT_SYMBOL_NS*() are considered exported in > a namespace. A module that makes use of a symbol exported with such a > namespace is required to import the namespace via MODULE_IMPORT_NS(). > There is no technical reason to enforce correct namespace imports, > but it creates consistency between symbols defining namespaces and > users importing namespaces they make use of. This option relaxes this > requirement and lifts the enforcement when loading a module. That's a lot better. Especially moving the "This option relaxes..." to the bottom. Thanks. -Saravana