Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp794128imu; Tue, 27 Nov 2018 06:26:03 -0800 (PST) X-Google-Smtp-Source: AJdET5crNCNWIDaxvX0Pj4csquHrYZ3WIZdywWrPyuKaGncIqMp3UL2K/RqPfNgN68IXJTJplhrr X-Received: by 2002:a62:18ce:: with SMTP id 197mr34189155pfy.88.1543328763656; Tue, 27 Nov 2018 06:26:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543328763; cv=none; d=google.com; s=arc-20160816; b=sogEzKRMe2/pcznbZEMh0DrPWBjNVlfD8PB9cpA9xJHyl0wVjUTf7aKu0LskSE1AjJ 2/B/c3Lo5pemQ7Akck3q8Nm0I5V0r38kKF0U+WZkMn8+kPdctuAXKCBVkq09oUJC6vZg Yk04taoeuXXaBZPC9H4tPvGVUJ9fi/H7fZw6C3mW/2g9PEov/XOHbPPfIVLuWaG1Ft2O zVPGwcyTjGjAUjYK0zpAKZHKX9fjV/M4J7oeihik4Q+fX3EfPBo5JU/kogpDaSAf3FVa UAEI4iwmtcdsr0OZDUM92/ayMhvI+FjlwWZqUMX/01Y67hRyKJl2yoVhIflSBxKqKm4g odWA== 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; bh=hi9iX299DQInLmJAtW0O641VhL4ev2inw/6dRwxQFJs=; b=C3qqX+ORblsX3HRozZwXgG4jQBBbNgtp2X9Zebmx6czaA5VtdaGwEfT8KRNVcpfpI2 pt4D82CW04bT7Tkmvc1GLMKOQYBo0nxYqoIJgtYF2YVZIgqFfFUvGBRKTlPJQU14tBk7 gy65pIbQfwbTMk601ucMjrmsD+5PwnmpKfVSXy/FAkH6zEMRt0TZaGdwSrZfaJ6pEG48 TZucuKbg3MXhM7R0AGar4dd8y87tnFtPZLLn4pBQmQegReGmC9oBHxZYWEtSkLepOrZo 2uutFZKe+esUD9hW5ZoegAN10SVlNGo7YyGsw+P0fnS432CTP1jFpH5RIcavJEkrbvCA 4bWQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14si4033985pgh.39.2018.11.27.06.25.34; Tue, 27 Nov 2018 06:26:03 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727590AbeK1Atm (ORCPT + 99 others); Tue, 27 Nov 2018 19:49:42 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:41792 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727569AbeK1Atm (ORCPT ); Tue, 27 Nov 2018 19:49:42 -0500 Received: by mail-ot1-f66.google.com with SMTP id u16so20128813otk.8 for ; Tue, 27 Nov 2018 05:51:42 -0800 (PST) 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=hi9iX299DQInLmJAtW0O641VhL4ev2inw/6dRwxQFJs=; b=AWSZPcZyaHBaNGwILCBSWAV6yYNPc2udlvGdHIWJEyeaKSXJE2nJtll5bgBi7NGrrN j7f0kYQ9UnWyqd1EkLkSZ2YNsP6kNa2RuZ0FiyJQco94smCqdOgAkUjrY110UbVyid+n trqCePPpW9UuUAgHu2TJeEcE1EljFakrLyDsIUVpfSq3bKaOF3/IacSThv4NoyDg4IQM Z7VceINl8GTeHOsPR0KUWN259PbI+nVOij3VLC2ytvBS+oloIWe3E1+trpTkL9YJJdDU tLTX0pTQBg0/MZCcX4hLq/J9/E36XMFqs1m/QX8Ob4Kize5XgCRZEtVOEJ99FHkBUhZ2 0+Jg== X-Gm-Message-State: AA+aEWawIiGwoqKowOKVj5QNl9UH+x4O4/g/U7DZLKKiXnGTts5GTvJt F46jorbCvrh6H74WOqGLpjUtQhlAB/uhvoOnQUkjDw== X-Received: by 2002:a9d:32c7:: with SMTP id u65mr17415964otb.236.1543326702007; Tue, 27 Nov 2018 05:51:42 -0800 (PST) MIME-Version: 1.0 References: <50db058a-7dde-441b-a7f9-f6837fe8b69f@schaufler-ca.com> In-Reply-To: From: Ondrej Mosnacek Date: Tue, 27 Nov 2018 14:51:30 +0100 Message-ID: Subject: Re: [PATCH v5 01/38] LSM: Introduce LSM_FLAG_LEGACY_MAJOR To: keescook@chromium.org Cc: casey@schaufler-ca.com, s.mesoraca16@gmail.com, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, Linux kernel mailing list , mic@digikod.net, Linux Security Module list , SElinux list , linux-fsdevel@vger.kernel.org, Stephen Smalley , adobriyan@gmail.com 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, Nov 27, 2018 at 2:27 PM Kees Cook wrote: > 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"? Not to mention that you are sending (only) to the old SELinux mailing list. The new list is at selinux@vger.kernel.org, see: https://lore.kernel.org/selinux/8263f9fa-16f1-1d0a-e391-61d609e50d7d@tycho.nsa.gov/ > > > > > 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 > _______________________________________________ > Selinux mailing list > Selinux@tycho.nsa.gov > To unsubscribe, send email to Selinux-leave@tycho.nsa.gov. > To get help, send an email containing "help" to Selinux-request@tycho.nsa.gov. -- Ondrej Mosnacek Associate Software Engineer, Security Technologies Red Hat, Inc.