public inbox for linux-security-module@vger.kernel.org
 help / color / mirror / Atom feed
From: John Johansen <john.johansen@canonical.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	Casey Schaufler <casey@schaufler-ca.com>,
	Paul Moore <paul@paul-moore.com>
Cc: LSM List <linux-security-module@vger.kernel.org>,
	James Morris <jmorris@namei.org>,
	linux-audit@redhat.com, Mimi Zohar <zohar@linux.ibm.com>,
	keescook@chromium.org, SElinux list <selinux@vger.kernel.org>
Subject: Re: LSM stacking in next for 6.1?
Date: Thu, 15 Sep 2022 00:45:50 -0700	[thread overview]
Message-ID: <e7e7d647-e903-4533-f146-befc77ff25c0@canonical.com> (raw)
In-Reply-To: <2225aec6-f0f3-d38e-ee3c-6139a7c25a37@I-love.SAKURA.ne.jp>

On 9/14/22 06:57, Tetsuo Handa wrote:
> On 2022/09/13 23:45, Casey Schaufler wrote:
>>> . A security module that manages loadable LSM modules cannot give us a good answer
>>> if there is a kernel config option to disable the manager security module.
>>
>> The community that is absolutely opposed to loadable modules will disagree.
> 
> Who are members of that community?
> 
> Hiding security_hook_heads from /proc/kallsyms has no value from security
> perspective, for malicious loadable kernel modules can calculate the address
> of security_hook_heads based on addresses of relevant functions and byte-code
> in the relevant functions.
> 
> Keeping __lsm_ro_after_init might have a little value, but at the same time
> it might make kernel less secure (or more prone to memory corruption) due to
> the need to pass rodata=0 kernel command line option when a loadable module
> LSM is loaded.
> 
> 
> 
>>> The kernel config option and distribution's policy are preventing users from using
>>> non-builtin LSMs in distributor's kernels. It is a trivial task to make TOMOYO work
>>> in distributor's kernels if above-mentioned changes are accepted.
>>
>> You should be able to use TOMOYO as a built-in along side other security modules
>> today. Aside from getting the distribution to include it in their kernel
>> configuration, which is admittedly no mean feat, and getting any user-space you
>> need included, you should already have what you need.
> 
> That's a chicken-and-egg problem.
> 
> Yes, we can use TOMOYO as a built-in along side other security modules for
> _user-built_ kernels. But no, we can't use TOMOYO for _distributor-built_ kernels
> (namely, Fedora/CentOS Stream/RHEL kernels).
> 
>>> https://bugzilla.redhat.com/show_bug.cgi?id=542986
>>
>> Ten years ago they said "Don't want to, aren't going to". Sadly, I doubt
>> there would be a different attitude today. The decision to support a security
>> module in a distribution is serious. I can definitely see how Redhat would
>> have their hands full supporting SELinux.
> 
> Please distinguish the difference between "enable" and "support" at
> https://bugzilla.redhat.com/show_bug.cgi?id=542986#c7 . (By the way,
> I hate the word "support", for nobody can share agreed definition.)
> 
> "enable" is something like "available", "allow to exist".
> 
> "support" is something like "guaranteed", "provide efforts for fixing bugs".
> 
> However, in the Red Hat's world, "enable" == "support". The kernel config options
> enabled by Red Hat is supported by Red Hat, and the kernel config options Red Hat
> cannot support cannot be enabled by Red Hat.
> 
> On the contrary, in the vanilla kernel's world, the in-tree version of TOMOYO
> cannot be built as a loadable module LSM. And it is impossible to built TOMOYO
> as a loadable module LSM (so that TOMOYO can be used without the "support" by
> Red Hat). As a result, users cannot try LSMs (either in-tree or out-of-tree)
> other than SELinux.
> 
> The negative effect is not limited to TOMOYO.
> Like Paul Moore said
> 
>    However, I will caution that it is becoming increasingly difficult for people
>    to find time to review potential new LSMs so it may a while to attract sufficient
>    comments and feedback.
> 
> , being unable to legally use loadable LSMs deprives of chances to develop/try
> new LSMs, and makes LSM interface more and more unattractive. The consequence
> would be "The LSM interface is dead. We will give up implementing as LSMs."
> 
> It is exactly "only in-tree and supported by distributors is correct" crap.
> 

for some users, but having a very well defined support surface also has its
place. From a distro POV support is expensive and its amazing what users
will do and try to hide while trying to get support.

Personally I prefer splitting enable and support but there are situations
where that isn't even allowed (some certifications). So I can understand
where they are coming from.

It just sucks for the users and projects that aren't "supported".

> I don't like closed-source kernel modules that rewrite syscall tables (e.g.
> used by AntiVirus), for I can't analyze problems when something went wrong.

Does anyone?

> If LSMs were available to open-source out-of-tree kernel modules, this situation
> could be improved.
> 
you are more optimistic than I am. What makes you think a distro like RH will
enable loading out-of-tree kernel modules if they aren't enabling TOMOYO
that is already in the kernel.

If loadable LSM modules are allowed, there will likely be a kernel config
to disable them and there will definitely be an interface that allows
blocking them. So whether via config option or run time control I don't
see RH allowing them.

> 
> 
> I think that syzbot is the most aggressive tester of TOMOYO security module.
> But how many bugs did syzbot found in TOMOYO? How many distributors that
> enabled TOMOYO in their kernels got bug reports regarding TOMOYO?
> 
> There might be reports like "When do you start providing ready-made policy
> configurations?", but what Josh Boyer worried at
> https://bugzilla.redhat.com/show_bug.cgi?id=542986#c8
> 
>    Simply put, we do not have the time to deal with any potential kernel bug
>    reports that would come from enabling TOMOYO.  It would be a disservice to
>    our users to enable something we have no intention of attempting to fix
>    when it is broken.
> 
> did not happen, and
> 
>    Even if it was 100% perfect code and caused no bug reports for the kernel,
>    it is still bloat and while it might not seem like it we are actually
>    trying to cut down on the size of our installed kernels.
> 
> can be solved by allowing loadable module LSMs.
> 
> Loadable module LSM also breaks distributor's "enable" == "support" spell.
> 

sadly I really don't think it will

> 
> 
>> A loadable module would have to be managed differently from a built-in one.
>> Hence the notion of a loadable module manager.
> 
> We can make management up to module authors, like the comment of security_delete_hooks().
> (Well, I'm not proposing ability to unload. I'm proposing only ability to load LSMs
> as loadable kernel modules.)
> 


  parent reply	other threads:[~2022-09-15  7:46 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <791e13b5-bebd-12fc-53de-e9a86df23836.ref@schaufler-ca.com>
2022-08-03  0:01 ` LSM stacking in next for 6.1? Casey Schaufler
2022-08-03  0:56   ` Paul Moore
2022-08-03  1:56     ` John Johansen
2022-08-03  2:15     ` Casey Schaufler
2022-08-03  2:33       ` Paul Moore
2022-08-03  2:34     ` Steve Grubb
2022-08-03  2:40       ` Paul Moore
2022-09-02 21:30     ` Paul Moore
2022-09-02 23:14       ` Casey Schaufler
2022-09-02 23:57         ` Casey Schaufler
2022-09-06 23:24         ` Paul Moore
2022-09-07  0:10           ` John Johansen
2022-09-07  0:39             ` Casey Schaufler
2022-09-07  0:50               ` John Johansen
2022-09-07 14:41             ` Paul Moore
2022-09-07 16:41               ` Casey Schaufler
2022-09-07 17:23                 ` John Johansen
2022-09-07 22:57                   ` Paul Moore
2022-09-07 23:27                 ` Paul Moore
2022-09-07 23:53                   ` Casey Schaufler
2022-09-08  0:19                     ` John Johansen
2022-09-08  3:57                     ` Paul Moore
2022-09-08 18:05                       ` Casey Schaufler
2022-09-08 18:35                         ` John Johansen
2022-09-08 19:32                         ` Paul Moore
2022-09-08 22:56                           ` Casey Schaufler
2022-09-10  4:17                             ` Tetsuo Handa
2022-09-12 17:37                               ` Casey Schaufler
2022-09-13 10:47                                 ` Tetsuo Handa
2022-09-13 14:45                                   ` Casey Schaufler
2022-09-14 13:57                                     ` Tetsuo Handa
2022-09-14 15:50                                       ` Casey Schaufler
2022-09-15 14:27                                         ` Tetsuo Handa
2022-09-15 14:54                                           ` John Johansen
2022-09-15  7:45                                       ` John Johansen [this message]
2022-09-15 14:27                                         ` Tetsuo Handa
2022-10-25  9:48                                       ` Tetsuo Handa
2022-10-25 10:26                                         ` John Johansen
2022-10-25 11:20                                           ` Tetsuo Handa
2022-10-25 14:12                                             ` Casey Schaufler
2022-10-25 22:12                                               ` Tetsuo Handa
2022-10-25 22:41                                                 ` Casey Schaufler
2022-10-26 10:19                                                   ` Tetsuo Handa
2022-10-26 15:30                                                     ` Casey Schaufler
2022-10-28 10:14                                                     ` John Johansen
2022-10-30  4:03                                                       ` Tetsuo Handa
2022-10-30  7:23                                                         ` John Johansen
2022-10-30 14:02                                                           ` Tetsuo Handa
2022-10-30 16:37                                                             ` Kees Cook
2022-10-30 20:56                                                               ` Casey Schaufler
2022-10-31 10:26                                                               ` Tetsuo Handa
2022-10-31 15:47                                                                 ` Casey Schaufler
2022-10-26 20:11                                             ` Paul Moore
2022-10-27  0:02                                               ` Tetsuo Handa
2022-10-28  9:50                                                 ` Paul Moore
2022-10-28 13:58                                                   ` Tetsuo Handa
2022-10-28 17:40                                                     ` Kees Cook
2022-10-29  9:33                                                       ` Tetsuo Handa
2022-09-14 13:42                             ` Paul Moore
2022-09-27 20:54                               ` Casey Schaufler
2022-09-27 22:37                                 ` Paul Moore
2022-09-07  0:31           ` Casey Schaufler
2022-09-07 15:13             ` Paul Moore
2022-09-07 17:08               ` Casey Schaufler
2022-09-07 23:04                 ` Paul Moore
2022-09-07 23:26                   ` Casey Schaufler
2022-09-08 15:18   ` Tetsuo Handa
2022-09-08 16:00     ` Casey Schaufler
2022-09-08 18:52     ` Paul Moore
2022-09-09 11:32       ` Tetsuo Handa
2022-09-14 13:56         ` Paul Moore
2022-09-15 14:27           ` Tetsuo Handa
2022-09-15 15:50             ` Casey Schaufler
2022-09-16 13:34               ` Tetsuo Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e7e7d647-e903-4533-f146-befc77ff25c0@canonical.com \
    --to=john.johansen@canonical.com \
    --cc=casey@schaufler-ca.com \
    --cc=jmorris@namei.org \
    --cc=keescook@chromium.org \
    --cc=linux-audit@redhat.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=selinux@vger.kernel.org \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox