Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp875849imm; Mon, 1 Oct 2018 21:50:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV611iwYlWpFeb4j/vP4KRE3VpTXPfQm97+XGQX5aph4rPMeXXNZRbX0MpYHxyjrKnKDuTr+y X-Received: by 2002:a63:5558:: with SMTP id f24-v6mr13064646pgm.37.1538455817411; Mon, 01 Oct 2018 21:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538455817; cv=none; d=google.com; s=arc-20160816; b=WHbBjZ3+mRFupm2vPAy9Da73QAK+UYfpcs6ys1cur44BkVYqCk88amAhUMuvrqMpTY gO/fnq5nBPrWUP1z05dHt+VE4f7aCWJwl+M7t/gfUSUNqhCiCA50TYzOo3M4dm0CJdY1 uMNt0UUT+zBHeKoaWpLW+xigjnbJDszDxjbri/J9lpK+ncQfLy/6i36P6xz9LIsGkJ5J NvwceGdmTzkd6XmCfGg56V615raYCg5nZuUBv/2VlHUtCo3Qo/TRltWg+uLLoQe9GODD 2mIQ2bhV0J4itGF9rR9aT8MYWySEeTlpZKp5gwnwfCiLhZ4kkN8K8QPL2kPSMDLHNR8q MmEQ== 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=L/iz8UGDhqnhQj14wynEEGVGj6CSwWszHDf61Vdh6eA=; b=MwDgObFt9br8+EXibxnWvyIOx+rpJmg/Pa/ueAdKIxD+k+wtyjJ2xrk6/+rTyvn3iv zgCxhrypTAqxU3dJepurb6XK5bIZEqwXqWVWyiWj2J21m2qQkaFB6hRXVPo8x0oBfiJj 5ysRByNxmZNA2YqH1Yj7gfyHFKu10cvoICG7uq//tiL1pvmXcbjor7hy+Jcg2AmfWFwj USyqFDtqZBGItkY7rCm26tdnFg0WZ64Ae7hd3yvHjSFGRFVS2vkJZRgqHgOuN9TJPFaG Y7hWRneXjRUsIspd1oo6klX0xkwUP9WHVWgs7JBjmuU7OtByxNBX5ge6AkCsXtfroai9 oxaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VbNZXoJm; 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 t7-v6si14186806pfh.3.2018.10.01.21.50.02; Mon, 01 Oct 2018 21:50: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=@chromium.org header.s=google header.b=VbNZXoJm; 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 S1726867AbeJBLa6 (ORCPT + 99 others); Tue, 2 Oct 2018 07:30:58 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:39441 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726276AbeJBLa5 (ORCPT ); Tue, 2 Oct 2018 07:30:57 -0400 Received: by mail-yb1-f193.google.com with SMTP id c4-v6so281958ybl.6 for ; Mon, 01 Oct 2018 21:49:41 -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=L/iz8UGDhqnhQj14wynEEGVGj6CSwWszHDf61Vdh6eA=; b=VbNZXoJmnWC1w45hkLStsc8iddHSdBp2k4Mt/MM+ztPG8n/P3SWUZUltyFVtGDCw6P W8XX+xcaxke590MdOoIZix3BaFn6cwJpqP1Ss828Tig1csdWOSdA+TQHK2ntxvzfTM23 tJYCzp5T/G3FXZylyqTiq/5E3xXK4sJV7whi8= 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=L/iz8UGDhqnhQj14wynEEGVGj6CSwWszHDf61Vdh6eA=; b=YH3B9W/W8T7Hz5mN1KsmxygGwBwJvhQPNMbE5YJ2ff2yoEPCTZgKfIP9/7eLqR22JL QHprm6ugR2sDtyxX3K5J0PuizL/cM5Qxm5OqH5fcxrs9S4/ev2JRWntVYZA/VexpQYsc pA+Q5RA/ebVrJbVZx2vs68leSXzhL/C/kPh2qZYcoUsFjQnVB5SXANTbNGyl1lsxfyXa BuluzbqZgkX3CW7kbGntmOtBhHHTgf2bTGf7UcjTSARxmFclxUc0t6tBAWwfinNRX9ri 9bfUkHbs5sgYgqvrwwRRu9PUahjO0Y/lvZKPY7fB3wvjfn+sMzGDQO7/DVbpC5J8TC+7 0q4g== X-Gm-Message-State: ABuFfoibIjQ0Ak/dXZ0C6a0zq3DbfCw7M4VCyzfsiSh9eGdUaIAaN5tW MIs1TMY2+7VyRWPynT/JqwR/GREOrJo= X-Received: by 2002:a25:ae28:: with SMTP id a40-v6mr7849056ybj.365.1538455781214; Mon, 01 Oct 2018 21:49:41 -0700 (PDT) Received: from mail-yw1-f52.google.com (mail-yw1-f52.google.com. [209.85.161.52]) by smtp.gmail.com with ESMTPSA id 189-v6sm5627543ywf.4.2018.10.01.21.49.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Oct 2018 21:49:39 -0700 (PDT) Received: by mail-yw1-f52.google.com with SMTP id e201-v6so274329ywa.3 for ; Mon, 01 Oct 2018 21:49:38 -0700 (PDT) X-Received: by 2002:a81:2908:: with SMTP id p8-v6mr7682701ywp.407.1538455778198; Mon, 01 Oct 2018 21:49:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:d116:0:0:0:0:0 with HTTP; Mon, 1 Oct 2018 21:49:37 -0700 (PDT) In-Reply-To: References: <20181002005505.6112-1-keescook@chromium.org> <20181002005505.6112-22-keescook@chromium.org> From: Kees Cook Date: Mon, 1 Oct 2018 21:49:37 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH security-next v4 21/32] LSM: Finalize centralized LSM enabling logic To: Randy Dunlap Cc: James Morris , Casey Schaufler , John Johansen , Tetsuo Handa , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , 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 Mon, Oct 1, 2018 at 6:18 PM, Randy Dunlap wrote: > On 10/1/18 5:54 PM, Kees Cook wrote: >> Prior to this patch, default "enable" behavior was unchanged: SELinux >> and AppArmor were controlled separately from the centralized control >> defined by CONFIG_LSM_ENABLE and "lsm.enable=...". This changes the >> logic to give all control over to the central logic. >> >> Instead of allowing SELinux and AppArmor to override the central LSM >> enabling logic, by having separate CONFIG and boot parameters, this >> forces all "enable" variables to disabled, then enables any listed in >> the CONFIG_LSM_ENABLE and "lsm.enable=..." settings, and finally disables >> any listed in "lsm.disable=...". >> >> Signed-off-by: Kees Cook >> --- >> .../admin-guide/kernel-parameters.txt | 6 ++-- >> include/linux/lsm_hooks.h | 2 +- >> security/security.c | 32 +++++++------------ >> 3 files changed, 15 insertions(+), 25 deletions(-) >> >> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt >> index 67c90985d2b8..f646cfab5613 100644 >> --- a/Documentation/admin-guide/kernel-parameters.txt >> +++ b/Documentation/admin-guide/kernel-parameters.txt >> @@ -2279,14 +2279,12 @@ >> lsm.disable=lsm1,...,lsmN >> [SECURITY] Comma-separated list of LSMs to disable >> at boot time. This overrides "lsm.enable=", > > better: This overrides "lsm.enable=" and Eek, yes! Thank you. :) -Kees > >> - CONFIG_LSM_ENABLE, and any per-LSM CONFIGs and boot >> - parameters. >> + CONFIG_LSM_ENABLE. >> >> lsm.enable=lsm1,...,lsmN >> [SECURITY] Comma-separated list of LSMs to enable >> at boot time. This overrides any omissions from >> - CONFIG_LSM_ENABLE, and any per-LSM CONFIGs and >> - boot parameters. >> + CONFIG_LSM_ENABLE. >> >> machvec= [IA-64] Force the use of a particular machine-vector >> (machvec) in a generic kernel. > > > -- > ~Randy -- Kees Cook Pixel Security