Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1548756imm; Tue, 2 Oct 2018 09:56:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV60e40c2DgWFlsoMIgVq48CJbuU3eRlaAY/n9TchBBJ9fEz3kjmbxD0uchjh1hc5Vm4BaPy9 X-Received: by 2002:a65:53c9:: with SMTP id z9-v6mr15039171pgr.203.1538499383950; Tue, 02 Oct 2018 09:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538499383; cv=none; d=google.com; s=arc-20160816; b=KnRvoNcu6ou9z8pKJOY06wVL2+4ofk61Qvwaj9jkgowj+Sl75dyEI98LvLuw+N9xry MhvV6ZN+P+t2vr9LtCLMGuU7r+W/DPurz3OcdU7ED7xtzBaRB6NFA79/pAe1D97nGgR6 /a16W/o1z07KZUOokJa0/G73Tk4Kt9n2rO5BUvMrHDE7cHxfDi2OAPt7cv8B9XMyE8aZ tkty2+ZpotCRWHCci9/7AXQJ20yDYEH0fCsHJfDfxrNziNmokBl3G4+dCbzcgt5KIcfO 1VqIodv+bUJdfJt6kRk6fOsM+te4QR4Kcqjle3OceQFgi4DfmzUuppiHfRvqTcpD/MKB MusQ== 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 :references:in-reply-to:mime-version:dkim-signature; bh=79+/1lnmQzDOwK5HjNBMwdoNS2u8Fqf6+NB+3YIyrKs=; b=soldA2k3gURy7uIm1rwNTi0/NFpSa/qNKo4QjerC7cZ1+grfeafTuYgSqkcmO8Xz1W pI6Y6m8GOWshU8Gozoyi7fryVl4EwmO4yGM7mi/wPtfS2dFC1w6w5AUxucIXQ4ugy7vJ YpVCgwOdaC1LjWzIiAYUsjt91tsFl6YJxe/6wsr0sx72FglwCJZ4fyaoISr5wdcj3nT9 eJi0bKr0Tn0wsuvFp5agAwhg311KKu3uFNLyZ7ireeHbABZR7NX0WnwIhznn6GkIKfsz RCLfo42TgGx2a7T0TCaVAbronlVrwW9Y7YpcTV7qxEWRkPe8RYd8FnuaJUUFMFCqP8wR UxPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hVKPWYCQ; 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 i198-v6si1743164pgd.17.2018.10.02.09.56.08; Tue, 02 Oct 2018 09:56:23 -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=@chromium.org header.s=google header.b=hVKPWYCQ; 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 S1728520AbeJBXSl (ORCPT + 99 others); Tue, 2 Oct 2018 19:18:41 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:34921 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728298AbeJBXSk (ORCPT ); Tue, 2 Oct 2018 19:18:40 -0400 Received: by mail-yw1-f66.google.com with SMTP id y76-v6so1018349ywd.2 for ; Tue, 02 Oct 2018 09:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=79+/1lnmQzDOwK5HjNBMwdoNS2u8Fqf6+NB+3YIyrKs=; b=hVKPWYCQf4YO1PzD8ic2zHzeBnAZmrxWciQlXzQW9jE5qrO3YTGORvqcIbtlfPrwRU 0EE/v1d4SErKRtJ0y7iTO1Wrhw72FZqW796mUgEejUuDXsrRvUfD0wCEY8/YobRlevwi eJePZNVgA5yHLLC/7+1X1HX0Ri4k/wqhPkfTI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=79+/1lnmQzDOwK5HjNBMwdoNS2u8Fqf6+NB+3YIyrKs=; b=sOtypr+/58s4pXNm8lmlBcWYoLrgh8OwMfeD+XYdvcSPvi53gEYrds0kZ3alwMSGyt VJNMVeKDgAVCW0wjKCU/DIKmbW4pavN84Kuve6BkWUq0k3+PK1r1V6hnRDsn9IHqtqeP ibiRlAPhUDvC3UDaCTh3Xma1tdHsDhXXomOMnfj1Bp7Aj0wtb98UP5CQVDcBZswWVzl8 jp+Q+M9NEyGZPnSQFnVUYOXkF6lxhkCH7HS/wYiTI7GEUYGkPxZ7wcBWkkmo8rhfvj0q VLS1UmlaQaSbZPqKgSd83aVLLELbm3rCz8l+X4lBdwNmMKdt4OZ5ONvXYafEuyDZ9ohO /wWg== X-Gm-Message-State: ABuFfojBzIK9Cakgg1V3bdSsyVYdz1y39HNcP8qekHGBxaPo+wiN80Nb EtyOmMwocrN6yxXEAT3ICzAyZ7UXENs= X-Received: by 2002:a81:3c57:: with SMTP id j84-v6mr324232ywa.448.1538498065205; Tue, 02 Oct 2018 09:34:25 -0700 (PDT) Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com. [209.85.219.179]) by smtp.gmail.com with ESMTPSA id p185-v6sm3267637ywc.14.2018.10.02.09.34.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 09:34:23 -0700 (PDT) Received: by mail-yb1-f179.google.com with SMTP id o63-v6so1054868yba.2 for ; Tue, 02 Oct 2018 09:34:23 -0700 (PDT) X-Received: by 2002:a25:dd82:: with SMTP id u124-v6mr8866057ybg.171.1538498062769; Tue, 02 Oct 2018 09:34:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:d116:0:0:0:0:0 with HTTP; Tue, 2 Oct 2018 09:34:22 -0700 (PDT) In-Reply-To: <809f1cfd-077b-ee58-51ba-b22daf46d12b@tycho.nsa.gov> References: <20181002005505.6112-1-keescook@chromium.org> <20181002005505.6112-24-keescook@chromium.org> <785ef6a9-ae46-3533-0348-74bcf6f10928@tycho.nsa.gov> <809f1cfd-077b-ee58-51ba-b22daf46d12b@tycho.nsa.gov> From: Kees Cook Date: Tue, 2 Oct 2018 09:34:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH security-next v4 23/32] selinux: Remove boot parameter To: Stephen Smalley Cc: Paul Moore , James Morris , Casey Schaufler , John Johansen , Tetsuo Handa , "Schaufler, Casey" , linux-security-module , Jonathan Corbet , "open list:DOCUMENTATION" , linux-arch , LKML 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 Tue, Oct 2, 2018 at 7:58 AM, Stephen Smalley wrote: > On 10/02/2018 10:44 AM, Kees Cook wrote: >> >> On Tue, Oct 2, 2018 at 6:42 AM, Stephen Smalley wrote: >>> >>> On 10/02/2018 08:12 AM, Paul Moore wrote: >>>> >>>> >>>> On Mon, Oct 1, 2018 at 9:04 PM Kees Cook wrote: >>>>> >>>>> >>>>> Since LSM enabling is now centralized with CONFIG_LSM_ENABLE and >>>>> "lsm.enable=...", this removes the LSM-specific enabling logic from >>>>> SELinux. >>>>> >>>>> Signed-off-by: Kees Cook >>>>> --- >>>>> .../admin-guide/kernel-parameters.txt | 9 ------ >>>>> security/selinux/Kconfig | 29 >>>>> ------------------- >>>>> security/selinux/hooks.c | 15 +--------- >>>>> 3 files changed, 1 insertion(+), 52 deletions(-) >>>>> >>>>> diff --git a/Documentation/admin-guide/kernel-parameters.txt >>>>> b/Documentation/admin-guide/kernel-parameters.txt >>>>> index cf963febebb0..0d10ab3d020e 100644 >>>>> --- a/Documentation/admin-guide/kernel-parameters.txt >>>>> +++ b/Documentation/admin-guide/kernel-parameters.txt >>>>> @@ -4045,15 +4045,6 @@ >>>>> loaded. An invalid security module name will >>>>> be >>>>> treated >>>>> as if no module has been chosen. >>>>> >>>>> - selinux= [SELINUX] Disable or enable SELinux at boot >>>>> time. >>>>> - Format: { "0" | "1" } >>>>> - See security/selinux/Kconfig help text. >>>>> - 0 -- disable. >>>>> - 1 -- enable. >>>>> - Default value is set via kernel config option. >>>>> - If enabled at boot time, /selinux/disable can >>>>> be >>>>> used >>>>> - later to disable prior to initial policy load. >>>> >>>> >>>> >>>> No comments yet on the rest of the patchset, but the subject line of >>>> this patch caught my eye and I wanted to comment quickly on this one >>>> ... >>>> >>>> Not a fan unfortunately. >>>> >>>> Much like the SELinux bits under /proc/self/attr, this is a user >>>> visible thing which has made its way into a lot of docs, scripts, and >>>> minds; I believe removing it would be a big mistake. >>> >>> >>> >>> Yes, we can't suddenly break existing systems that had selinux=0 in their >>> grub config. We have to retain the support. >> >> >> Is it okay to only support selinux=0 (instead of also selinux=1)? > > > For Fedora/RHEL kernels, selinux=1 would be redundant since it is the > default. However, in other distros where SELinux is not the default, I > think they have documented selinux=1 as the way to enable SELinux. So users > may be relying on that as well. I don't think we can safely drop support for > either one. Sorry. Okay. How would you like to resolve this? Should SELinux remain "enable special", and AppArmor is okay to remove the LSM-specific enabling? The trouble is with handling CONFIG_LSM_ENABLE vs lsm.enable=... boot param vs the SELinux bootparam. I.e. CONFIG_LSM_ENABLE is redundant to SECURITY_SELINUX_BOOTPARAM_VALUE, and selinux= is redundant to lsm.enable=. Specifically, how should the kernel distinguish between the four settings? -Kees -- Kees Cook Pixel Security