Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3158971imj; Mon, 11 Feb 2019 15:10:52 -0800 (PST) X-Google-Smtp-Source: AHgI3IYtGzRPX6Gxkzez3jBmAD+isxDot4QK2PjOrsLEtZLOjQ1tNwF/RsKTsS4HQ2LVhv2hCYw6 X-Received: by 2002:a17:902:6502:: with SMTP id b2mr772832plk.44.1549926652775; Mon, 11 Feb 2019 15:10:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549926652; cv=none; d=google.com; s=arc-20160816; b=DQ0kkdxAOBt6wyBdZ2k5jY7OM1JK2rEtcs9u8GnFWAF7egwFiar8y87s4xEG4olvEs 0KBVPB37nG7ENp9F91dXn7jCxq6zjcST9OW2e8jkzIPG9GCsZvxHwx4NuOo+PANDAnPh cJEHXpE0Rh3X0M+nRcVkaSrVlD3oodrXLzCSU0I6Sm5FscfhV4HWOOI1lo59eLBFb00O FoH12Aq3Xs2bmeJ6/4oDcXfbiGDIYAXVHkgHtzKUzk2v5VdqMvKrqmTqpSbGMaNSRQe/ ZOuM+HL52+GdPMM3GiHE1NzG8fwoWct7TPzyn9vZFpRZ4pV1nw0HRFZGzM7cDTW9frIH 2pmQ== 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=RbZTTlJJHZ2TKiMRzWETCDAlGSq36U+ITQSW5SleAAs=; b=wIt694tOQVArdMrHUNgoZ7K/FwdZw3tZor9JhMX5wo4cK557QAtoTfhXiNoQ9XFP8D DWXBbvtWVz/yIgYC/L2KRYiEhe4RUYhYQVzxK7vtR3iOzlDVvyF5Ia6ezmfmfYNP5Snv NyJBadBrwceoma1jbVFqNXZlEuZWVQgrcK8RjGs2fvbBBlJkUDLNTy2w19oKtl/Nnm9H lj15XRr5FbqAtKqLRsruNZ8y1EfuoJmtvcVEsc/YpRhDLoDrhVq95ErDbaepz/w8V5PK phVxuYkMwIfc08hCkuz5Mz8NEEKnwa6Rwp3yK7ptt5HgPqGqQcVfyamoe1FzM1XcknKj Iajw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=mg4M3c4c; 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 x14si10954927plr.378.2019.02.11.15.10.37; Mon, 11 Feb 2019 15:10:52 -0800 (PST) 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=mg4M3c4c; 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 S1727835AbfBKXK3 (ORCPT + 99 others); Mon, 11 Feb 2019 18:10:29 -0500 Received: from sonic302-28.consmr.mail.gq1.yahoo.com ([98.137.68.154]:34630 "EHLO sonic302-28.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727674AbfBKXK0 (ORCPT ); Mon, 11 Feb 2019 18:10:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1549926625; bh=RbZTTlJJHZ2TKiMRzWETCDAlGSq36U+ITQSW5SleAAs=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=mg4M3c4cVaBlH0H6VHSN07pfRZJGZ5OAv0KTFuU91yRxvpw7+EF9IFEYe6Rh/O77ftMH0WHkQ/t0wxNP31PfFVhwT+sQ3zuhH8DSVu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ZNT4Jj9.0YYSwfGa6k_zS55xy1hnIow2kGi.mYrAW4AEjHjGFl7UMIuJug oNHi5iOcJ4O1tO_hgGzCQpQoRt61JKt8ZkUp0uV3N0iTt6b9Q67b3wqldTp0BeLVxa50A_9V6D97 Gfkx9xDi4BRsV13xbggUto7oZ3d1r7OwqQO9pitTJAtXm1w6edO1Axy_G430fS1agnaw738C2HUl Bnpgkl33KxvRParVvpvo2R1A99xA6mycRIodie06_mIsUkc7cKypKpXqL.Gdmv5NQdD561PNmOAc tlyyM8wnRxS_LAo5.aa__IE9ObhqVX1ElaA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Mon, 11 Feb 2019 23:10:25 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO [192.168.0.100]) ([67.169.65.224]) by smtp414.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 26a66dbf95c268d7b84dc9a6f21c5cef; Mon, 11 Feb 2019 23:10:23 +0000 (UTC) Subject: Re: [PATCH] LSM: Ignore "security=" when "lsm=" is specified To: Kees Cook , James Morris Cc: linux-security-module@vger.kernel.org, Tetsuo Handa , linux-kernel@vger.kernel.org References: <20190211225403.GA7769@beast> From: Casey Schaufler Message-ID: <74310e83-a258-e9c0-7d98-8b2cc5ced3a4@schaufler-ca.com> Date: Mon, 11 Feb 2019 15:10:20 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190211225403.GA7769@beast> 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 2/11/2019 2:54 PM, Kees Cook wrote: > To avoid potential confusion, explicitly ignore "security=" when "lsm=" is > used on the command line, and report that it is happening. > > Suggested-by: Tetsuo Handa > Signed-off-by: Kees Cook > --- > security/security.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/security/security.c b/security/security.c > index 3147785e20d7..e6153ed54361 100644 > --- a/security/security.c > +++ b/security/security.c > @@ -288,9 +288,13 @@ static void __init ordered_lsm_init(void) > ordered_lsms = kcalloc(LSM_COUNT + 1, sizeof(*ordered_lsms), > GFP_KERNEL); > > - if (chosen_lsm_order) > + if (chosen_lsm_order) { > + if (chosen_major_lsm) { > + pr_info("security= is ignored because of lsm=\n"); This is a little awkward. How about "lsm= supersedes security=". > + chosen_major_lsm = NULL; > + } > ordered_lsm_parse(chosen_lsm_order, "cmdline"); > - else > + } else > ordered_lsm_parse(builtin_lsm_order, "builtin"); > > for (lsm = ordered_lsms; *lsm; lsm++)