Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp290489imu; Mon, 26 Nov 2018 21:37:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/WGdSCZ5/8EJcSnePcP0gdecqpQSoMSx9zXzfrHFv9hYVCtNf1KiR2eTSIfjA1oTUHVxqAF X-Received: by 2002:a65:564b:: with SMTP id m11mr27151344pgs.216.1543297059252; Mon, 26 Nov 2018 21:37:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543297059; cv=none; d=google.com; s=arc-20160816; b=NEQZyZ+lSxJ7dhxFD96Xhp48tgu5o0b01j1uB9j353wD6Yztns4KMwRDoNeyM16cbd eE7ybJ2Z5kk/zg1F/0T9+J0ShmiHxFLmfbsHzpQ7D6CZC3T4hEtyrKUkO7VR05zAhzpj HLwHPoa5U7340ukZCq2ZqxhqYWOT4qR5LlvTGJX66RbgzjUsrE/U5RFd1lKd7vvkc+nG OkttFn4JOHPu8XARO38tySuaJH3ofG+2hMvJAGBjf54WU1bcp2C/gok0B21f1mTxK9bR kmh0OeT5i5VSndfMJ4OkiuptFhmkkSFfCnL5y6fvKfK52L9jByHI3nBHwKhNLb1Rx5cA gR0w== 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 :in-reply-to:references:mime-version:dkim-signature; bh=/omSkAw6P4Rj7FKfx5WJTuN6rcUIqdUCq/wshJQTtw0=; b=x0W7lZhse5CTdxtLl+vIsRA+kHKsGBI7aGmyvT63foQsC0F8Tpo5hQysDA7cPqTEAU CkZOYqARr98n5V/aT7ZG6MfwmT30qtItkE0i8VmDvPRn53182uAQtkTVw79+U0YvRewV rtno8inj0chJYr32ETRgsCvjn9sdPeRcOfTKa++nTKjCr4lUlZYtgQ9uTXF4cRVJiug7 w5YwAIEKyIZPkrz7cByiecRVOLmvX4g7KwtaCsXj0zCXWm50V40G9Rpgpc6kJEvzvJTP UD3JIEdBONhdRwTVv42I3INRUfSmZQiiyiLVz9eLVqBXPjSpgnL4/Ej2+PgSvsUck5Ep 30mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Bx4gPVm9; 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 g12si2624923pgd.567.2018.11.26.21.37.23; Mon, 26 Nov 2018 21:37:39 -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=Bx4gPVm9; 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 S1728735AbeK0QbN (ORCPT + 99 others); Tue, 27 Nov 2018 11:31:13 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:44223 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728171AbeK0QbM (ORCPT ); Tue, 27 Nov 2018 11:31:12 -0500 Received: by mail-yw1-f67.google.com with SMTP id h138-v6so6824556ywa.11 for ; Mon, 26 Nov 2018 21:34:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/omSkAw6P4Rj7FKfx5WJTuN6rcUIqdUCq/wshJQTtw0=; b=Bx4gPVm9X1ZbEiUOLyAtfukRlonEjTcdM86nr32HpuBEtfrZiKkmk2U6iQTUB/v/H7 2uhOzByMV8JAEvAyQf6cX4xhGOXWWaGPIn3/4GqcW2e7HVDu6PFZa5rV3N3pWIAsKjYi GEd0s5BXK1pk0hb3GsA0NmgH7GM0p6FikQ+hc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/omSkAw6P4Rj7FKfx5WJTuN6rcUIqdUCq/wshJQTtw0=; b=sOYeFN5pi2egaIqfjvDiXUF/kdcmda41wEZUZAchHoNcFqeMX2d1hcZAgq9tFndr// OkPGRDfggQQhZ3lCCeYEMM7jQUUMqlxRxk2RwKqDHnSf2FDrV0kwF3CfIQdKJ7Yk9/VD 3U0xZCx+GCeHXGUY5oBpITchxvEf1N7G6Rm+p3Yhd/3Fb9N2Avmo00EwO9WJiJSUgYkg 8a7yFxMtds/enKzpPrwuaUORiE0GnyhFQ9OAPbWmAvcbXUarIoyEYVnB0cyEOrOuBUjH ohZkCsQFkM0K2U2o9qDbRh89Vr9AgFtzHZRuthTdrT/cDQOj3WCVLyPDPUjzRDc5jqrE gf9w== X-Gm-Message-State: AGRZ1gLKmGfnGZCnWlECshZLo99Jm2h2duDGMQYGdIWzcfqxwSVislv/ RwMhZWc5Fp7BMzIOnzojquknSmlJxpo= X-Received: by 2002:a81:4d42:: with SMTP id a63mr32615217ywb.189.1543296869995; Mon, 26 Nov 2018 21:34:29 -0800 (PST) Received: from mail-yw1-f47.google.com (mail-yw1-f47.google.com. [209.85.161.47]) by smtp.gmail.com with ESMTPSA id r188sm689059ywb.30.2018.11.26.21.34.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Nov 2018 21:34:27 -0800 (PST) Received: by mail-yw1-f47.google.com with SMTP id f65so8633724ywc.8 for ; Mon, 26 Nov 2018 21:34:27 -0800 (PST) X-Received: by 2002:a81:760b:: with SMTP id r11-v6mr30130739ywc.353.1543296866988; Mon, 26 Nov 2018 21:34:26 -0800 (PST) MIME-Version: 1.0 References: <50db058a-7dde-441b-a7f9-f6837fe8b69f@schaufler-ca.com> In-Reply-To: From: Kees Cook Date: Mon, 26 Nov 2018 21:34:15 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 01/38] LSM: Introduce LSM_FLAG_LEGACY_MAJOR To: Casey Schaufler Cc: James Morris , linux-security-module , LKML , SE Linux , John Johansen , Tetsuo Handa , Paul Moore , "linux-fsdevel@vger.kernel.org" , Stephen Smalley , Alexey Dobriyan , =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= , Salvatore Mesoraca 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, Nov 26, 2018 at 3:26 PM Casey Schaufler wrote: Hmmm... the "From: Kees..." in the body is missing. Are you using "git send-email"? > > This adds a flag for the current "major" LSMs to distinguish them when > we have a universal method for ordering all LSMs. It's called "legacy" > since the distinction of "major" will go away in the blob-sharing world. > > Signed-off-by: Kees Cook > Reviewed-by: Casey Schaufler > Reviewed-by: John Johansen > --- > include/linux/lsm_hooks.h | 3 +++ > security/apparmor/lsm.c | 1 + > security/selinux/hooks.c | 1 + > security/smack/smack_lsm.c | 1 + > security/tomoyo/tomoyo.c | 1 + > 5 files changed, 7 insertions(+) > > diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h > index aaeb7fa24dc4..63c0e102de20 100644 > --- a/include/linux/lsm_hooks.h > +++ b/include/linux/lsm_hooks.h > @@ -2039,8 +2039,11 @@ extern char *lsm_names; > extern void security_add_hooks(struct security_hook_list *hooks, int count, > char *lsm); > > +#define LSM_FLAG_LEGACY_MAJOR BIT(0) > + > struct lsm_info { > const char *name; /* Required. */ > + unsigned long flags; /* Optional: flags describing LSM */ > int (*init)(void); /* Required. */ > }; > > diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c > index 42446a216f3b..2edd35ca5044 100644 > --- a/security/apparmor/lsm.c > +++ b/security/apparmor/lsm.c > @@ -1728,5 +1728,6 @@ static int __init apparmor_init(void) > > DEFINE_LSM(apparmor) = { > .name = "apparmor", > + .flags = LSM_FLAG_LEGACY_MAJOR, > .init = apparmor_init, > }; > diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c > index 7ce683259357..56c6f1849c80 100644 > --- a/security/selinux/hooks.c > +++ b/security/selinux/hooks.c > @@ -7209,6 +7209,7 @@ void selinux_complete_init(void) > all processes and objects when they are created. */ > DEFINE_LSM(selinux) = { > .name = "selinux", > + .flags = LSM_FLAG_LEGACY_MAJOR, > .init = selinux_init, > }; > > diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c > index 81fb4c1631e9..3639e55b1f4b 100644 > --- a/security/smack/smack_lsm.c > +++ b/security/smack/smack_lsm.c > @@ -4891,5 +4891,6 @@ static __init int smack_init(void) > */ > DEFINE_LSM(smack) = { > .name = "smack", > + .flags = LSM_FLAG_LEGACY_MAJOR, > .init = smack_init, > }; > diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c > index 1b5b5097efd7..09f7af130d3a 100644 > --- a/security/tomoyo/tomoyo.c > +++ b/security/tomoyo/tomoyo.c > @@ -552,5 +552,6 @@ static int __init tomoyo_init(void) > > DEFINE_LSM(tomoyo) = { > .name = "tomoyo", > + .flags = LSM_FLAG_LEGACY_MAJOR, > .init = tomoyo_init, > }; > -- > 2.14.5 > > -- Kees Cook