Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp15516imm; Thu, 20 Sep 2018 17:13:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY9Io68Xv2F7/NUHDQWpd4ggZWAY0GtD1kqfXxBG5YaGiydCXXpqn3zY6p/6pi/nZ+u2kHl X-Received: by 2002:a63:c807:: with SMTP id z7-v6mr38116116pgg.77.1537488826581; Thu, 20 Sep 2018 17:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537488826; cv=none; d=google.com; s=arc-20160816; b=jJNvMt8yEnEkjvpbmX6D2yg+GDDWFHS2Lmk/P22aTSrfwDW7cdVPTPbqGBQwG5kcrv 8I+FOr6tSIIvIqlwS9Ime9BcuYYK13C2nbfVFCUmOlehqFbfBsVkrvq7fsoQgVr+VNO1 r4uQPhI221/O3XyhrneNeY56Ew6y7jFOcqL0LAU7u9dRx00B/O7Z8pZwJ8Ot/5d54oeq 7moejDsVORo53KrJcmaYyMgt4Si/RoPvQSb2mt6g9Z3aKVe3Q6xezG3DsFKmDXJ3JoNH l32RyT4ft0GgyLOHyzxkUlG0PmlNpmimxIPmcrnwvg7n6fPkQgtSi2r6ZblUcbUJ2z74 U7yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=ddFYN2AxpEaOilHUU7cEDEP26gxa6oxv3prcGOIDDE4=; b=Ije4cH7+8YSGIOS6k1qxh3nHm4s/7Q6dFyc0/+YGB3cWswckhyV1v+tvs8/QcM81YM VO4yJqiiNTcDvCG3EWe/TCBJvCd3U9O6ugn+1uBtmbmbCfqMJfy1hVrcfq8IvHvgMNY7 l75zpWJK7HoQuRUAzO1fBUI0aIadneFwlCP9nKoLZqYs/41CnbM11Ju0+bAHdh0nEuBB Lx9mxZ5vBKfQ8fMDH7FifDA3ydIFukrw9y5XUQdMp6cFwHfzeCirQW5GokC7/n3UgLDA ATThzcYeO/okKEDVqycYvKOxovLTEuTfsr7PXhkN9u94T+carlE7oJkUDdAvhljR+Dxw RhEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=fOZKjSch; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j61-v6si23988002plb.49.2018.09.20.17.13.30; Thu, 20 Sep 2018 17:13:46 -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=@yahoo.com header.s=s2048 header.b=fOZKjSch; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388787AbeIUF6q (ORCPT + 99 others); Fri, 21 Sep 2018 01:58:46 -0400 Received: from sonic306-10.consmr.mail.bf2.yahoo.com ([74.6.132.49]:35556 "EHLO sonic306-10.consmr.mail.bf2.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbeIUF6o (ORCPT ); Fri, 21 Sep 2018 01:58:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1537488757; bh=ddFYN2AxpEaOilHUU7cEDEP26gxa6oxv3prcGOIDDE4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=fOZKjSchBRTRm5DcfZLoZh1rDXlgklSqRt2E2PErz2PQURgRrCj4SyWTtD0+a9Yw/c9L9NLFNDrrnhVNstpVDmSsB0xzgShexMVPZL/E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Jsnc 2L1z48rBNpVHwAs0aDocdQyF0nxSVvBSxZer4AHj19Mi9dFnQfh6eJJNXuVoTLsbmkEDUUJdGkMe jNGnJkHtUE9dVbQUXlJKo4evWegFo.p0BJDfuF9VElZkK0kUWtTq6hfxyjQVHf7J21XsCwBRRE4v hD7gXr8_BKOWruD3zZ3XE6ACOoMqPLr0jTuv2zzNfk28BGPcQAcLlSyTr9KzECWmfosYF2fwssjW 4qa9OV8Nv7Bs5LmvZxXvV.jCOuvYAsRuhVSKClQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Fri, 21 Sep 2018 00:12:37 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.102]) ([67.169.65.224]) by smtp402.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 075318250b282495fa2ab4dcaba9543a; Fri, 21 Sep 2018 00:12:34 +0000 (UTC) Subject: Re: [PATCH security-next v2 20/26] LSM: Introduce "lsm.order=" for boottime ordering To: Kees Cook , James Morris Cc: John Johansen , Tetsuo Handa , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , Jonathan Corbet , linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180920162338.21060-1-keescook@chromium.org> <20180920162338.21060-21-keescook@chromium.org> From: Casey Schaufler Message-ID: <71f833b8-40cb-83f8-6803-7df26e8fa460@schaufler-ca.com> Date: Thu, 20 Sep 2018 17:12:30 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180920162338.21060-21-keescook@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/20/2018 9:23 AM, Kees Cook wrote: > Provide a way to reorder LSM initialization using the new "lsm.order=" > comma-separated list of LSMs. Any LSMs not listed will be added in builtin > order. > > Signed-off-by: Kees Cook > --- > Documentation/admin-guide/kernel-parameters.txt | 5 +++++ > security/security.c | 15 ++++++++++++++- > 2 files changed, 19 insertions(+), 1 deletion(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 32d323ee9218..5ac4c1056ffa 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -2276,6 +2276,11 @@ > > lsm.debug [SECURITY] Enable LSM initialization debugging output. > > + lsm.order=lsm1,...,lsmN > + [SECURITY] Choose order of LSM initialization. Any > + builtin LSMs not listed here will be implicitly > + added to the list in builtin order. Added at the end of the list, or beginning of the list? > + > machvec= [IA-64] Force the use of a particular machine-vector > (machvec) in a generic kernel. > Example: machvec=hpzx1_swiotlb > diff --git a/security/security.c b/security/security.c > index 063ee2466e58..4db194f81419 100644 > --- a/security/security.c > +++ b/security/security.c > @@ -43,6 +43,7 @@ static ATOMIC_NOTIFIER_HEAD(lsm_notifier_chain); > char *lsm_names; > /* Boot-time LSM user choice */ > static __initdata const char *chosen_major_lsm; > +static __initdata const char *chosen_lsm_order; > > static __initconst const char * const builtin_lsm_order = CONFIG_LSM_ORDER; > > @@ -136,11 +137,15 @@ static void __init parse_lsm_order(const char *order, const char *origin) > kfree(sep); > } > > -/* Populate ordered LSMs list from builtin list of LSMs. */ > +/* Populate ordered LSMs list from commandline and builtin list of LSMs. */ > static void __init prepare_lsm_order(void) > { > struct lsm_info *lsm; > > + /* Parse order from commandline, if present. */ > + if (chosen_lsm_order) > + parse_lsm_order(chosen_lsm_order, "cmdline"); > + > /* Parse order from builtin list. */ > parse_lsm_order(builtin_lsm_order, "builtin"); > > @@ -264,6 +269,14 @@ static int __init choose_major_lsm(char *str) > } > __setup("security=", choose_major_lsm); > > +/* Explicitly choose LSM initialization order. */ > +static int __init choose_lsm_order(char *str) > +{ > + chosen_lsm_order = str; > + return 1; > +} > +__setup("lsm.order=", choose_lsm_order); > + > /* Enable LSM order debugging. */ > static int __init enable_debug(char *str) > {