Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3145122imj; Mon, 11 Feb 2019 14:54:52 -0800 (PST) X-Google-Smtp-Source: AHgI3IZH+oBNAH9OUcE1Xz1oehr/I/JqGylKH6HGSSQX8Z4dL7otLJTBQ+eVNrC3ofm7yZVaVPGf X-Received: by 2002:a17:902:820f:: with SMTP id x15mr668252pln.224.1549925692915; Mon, 11 Feb 2019 14:54:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549925692; cv=none; d=google.com; s=arc-20160816; b=VBeSFiGwScbDs1Qxmg/1JCx3l+8xlqXv/i+kSbkawr7YgWbgZoZCU4uwLYNNXSznR4 0KCWki0XgdE5DVzhYpZz9KkucJaNDj38vdYUTRqlIsGk+GbpR4i2epq9N3DyMIXn0f/8 VctvfAVfh/Fm2XfrFjcNBJNYwdFA00MujrlCGSZJ6HTZoMSDBONIHUWTGuJ7mt8Z8otQ +j4L8veooOORcGpDEXjOkxI2WaUono1u9UxeM7KgUHczscJbIl/6trMfZTOfMgGcVB09 64PAziyCmNhh/pty0vHhlcdGMpWeD8ZF67c5UEnLcLnkWlMEiDSBdS+SnppOqPdgc98D 468A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=DAhMB66WOye4Rsj6bDeOQbNbLoWJEGTVizWiNqAylXQ=; b=KglHS7ZW6jOBuPgqnAaURBX3fboKO9v0L/Ig1R6hXdqKpHv4bwL/JEKwRQ7MGdjJdA fW89ibccSeSuGuz+T6kkmQ6dn+cgt9Q9z3i4QoGpK6zzYnLMiogzWq25V04woGpU1+Bl Tt4iK+B8ROxr0yjwVWCg4WcBNHqul1EIS2eP1GLFReMrY3YJOph0ZAZaK4jgb5bxsZdM C3Z24dkjZybnd/bBXdQgAJPUoWZZBJCVPpC05ffSwLImiA5IeensJfft3AZgzzvThutb SFm4SnHSBtUdxhDyc5oSxxg2GqEZaSFGlDBVR1S6Wo3cOUBHpUo5kQznRPT611MkQQR3 bAeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=P8db4TPa; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b21si11215244pls.31.2019.02.11.14.54.37; Mon, 11 Feb 2019 14:54: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=@chromium.org header.s=google header.b=P8db4TPa; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727262AbfBKWyG (ORCPT + 99 others); Mon, 11 Feb 2019 17:54:06 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:39864 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbfBKWyG (ORCPT ); Mon, 11 Feb 2019 17:54:06 -0500 Received: by mail-pf1-f194.google.com with SMTP id f132so265788pfa.6 for ; Mon, 11 Feb 2019 14:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=DAhMB66WOye4Rsj6bDeOQbNbLoWJEGTVizWiNqAylXQ=; b=P8db4TPa00jf2gdKKbsQ4JR//27/enkXpoooyBg+8q37oeI9r+KJsbfjzUGRvsueLU fyzK+7yqAR5bjN2O0ltSJyKkztHw80ITBsWeJRQys1gcvytiD7vO+GmXI1yM9eykfcRS o+F/+mVfa7oclkW1vswNiWfBhQL8vx+jsixUQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=DAhMB66WOye4Rsj6bDeOQbNbLoWJEGTVizWiNqAylXQ=; b=CJ+DLCSuKmLLUrfTIX4qnBJZoEL3f3tBAemveMIHWfj7CGpP7xQz+Ybmxg4eVdjhRj LsaSbPCoFWAtDywlIQdFVIjg5Ucfa3/e7g9hwhZjbkFDbX2GoTGDIoU5WSIU8Ql7xZCD D9badvkSXRMSMyF8M0eleweiQnhSdNPzBsMvpmJhKU1MyHdhWVyGDWHQlpogXkc0m4CD LwcMkt8Mjdf+om04zU4L7IEpiWsl3DTit0Ma6hkGAjkTTBvYcb53HjeDgVqvxXBOxYKe WbpNs/f9foY01i6JnvxPva6etxTwIqry//uzSLQX9mmQF4d5IrE9eRqDmylRYUpXMjZ4 v6Vg== X-Gm-Message-State: AHQUAuZFUnoJMhwiDQcCEcYuEvgefmJVjSCQBAN0Xp+tnq/iPR26XTva P+cUEaBJNhl7IXzZ0sRAMfaMULci4Co= X-Received: by 2002:a63:c56:: with SMTP id 22mr626220pgm.44.1549925645759; Mon, 11 Feb 2019 14:54:05 -0800 (PST) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id m68sm6141079pfj.89.2019.02.11.14.54.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 14:54:04 -0800 (PST) Date: Mon, 11 Feb 2019 14:54:03 -0800 From: Kees Cook To: James Morris Cc: linux-security-module@vger.kernel.org, Tetsuo Handa , linux-kernel@vger.kernel.org Subject: [PATCH] LSM: Ignore "security=" when "lsm=" is specified Message-ID: <20190211225403.GA7769@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"); + 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++) -- 2.17.1 -- Kees Cook