selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: John Johansen <john.johansen@canonical.com>,
	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: Sun, 30 Oct 2022 13:03:57 +0900	[thread overview]
Message-ID: <53b07579-82f5-404e-5c2c-de7314fff327@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <f7548061-e82d-9a39-ed15-0d32551b4099@canonical.com>

On 2022/10/28 19:14, John Johansen wrote:
> On 10/26/22 03:19, Tetsuo Handa wrote:
>> On 2022/10/26 7:41, Casey Schaufler wrote:
>>>              You need a built-in LSM that loads and manages loadable
>>> security modules.
>>
>> That is no longer loadable LSM modules. A loadable LSM module must be capable of
>> loading any code and using any interface that is allowed to loadable kernel modules
>> using /sbin/insmod command. That is my understanding of what you have promised (and
>> the reason I am allowing you to continue working on LSM stacking before I make
>> CONFIG_SECURITY_TOMOYO=m).
>>
> 
> Tetsuo, think of it this way. LSM stacking is going to make it much easier for new
> LSM modules because they won't automatically be excluded because one of the other
> LSMs is needed.
> 
> The problem of loadable LSM modules is orthogonal, and Casey shouldn't need to
> solve it in this patch series. That is further work to be taken up by another,
> as Casey has clearly stated its work he is not interested in doing.
> 
> However the real problem you are trying to solve won't be solved by loadable LSM
> modules, though they may help. Just having loadable LSMs modules won't mean a
> distro will build an LSM as a loadable module instead of disabling it, nor does
> it mean a distro will allow loading an out of tree LSM module. Even if the
> upstream kernel doesn't provide an option to block loading them, distros will.
> 

What do you think the background of

  Ultimately the challenge is getting userspace developers to accept a
  change that is not part of the upstream Linux Kernel and thus not
  guaranteed under the usual "don't break userspace" kernel API promise.

is? I consider that the reason is because

  We do care about userspace programs and users who are using userspace programs.

. If we don't care about userspace and users, we would not mind breaking APIs.
This reasoning is more stronger than "we don't care about out-of-tree code"
reasoning.

Distributors have rights to block loading loadable kernel modules which are
not included in upstream kernels. But for example Red Hat is not excising
the rights to block loading loadable kernel modules (e.g.
https://access.redhat.com/solutions/1376133 ). What do you think about the
reasons of not blocking loading loadable kernel modules which are not included
in upstream kernels? I consider that the reason is because

  Allowing loadable kernel modules which cannot be supported by distributors
  to exist and to be loaded into distributor kernels is more beneficial for
  users.

That is, we have been allowing out-of-tree kernel code to exist because
out-of-tree kernel code can be beneficial for users despite distributors cannot
afford supporting out-of-tree kernel code.

If you really think that we have the rights to lock out out-of-tree kernel code
and/or disable loading of out-of-tree kernel code via /sbin/insmod, firstly achieve

  (1) Disallow loading of non-GPL kernel modules. (It is a trivial change.)

  (2) Disallow loading of out-of-tree kernel code via /sbin/insmod .
      (I don't know how we can technically enforce such change. Unlike not assigning
      LSM id value to LSM modules, we need to somehow be able to check whether an
      arbitrary file is in-tree (e.g. forbid "git add some_file") and unmodified
      (e.g. forbid "patch -p1 < some_patch").

before you enforce requiring an LSM id value in order to register an LSM module.
I don't accept "I'm not interested in making such changes". It is your duty to
achieve if you use "we don't care about out-of-tree code" as a rationale for
requiring an LSM id value in order to register an LSM module.

Nowadays, many software is developed using programming languages which can generate code
for multiple operating systems. That is, people are getting indifferent with operating
systems they run their software. Then, what is an advantage of choosing Linux as operating
systems for running their software, if Linux kernel does not provide freedom for
customization depending on user's needs?

As web application developers increases, developers who can understand C language (and
system call) are decreasing. As a result, it is getting more and more difficult to let them
understand and manage fine-grained allowlisting-based access controls like SELinux. Then,
what is an advantage of choosing Linux as operating systems for running their software, if
LSM does not provide freedom for using whatever simpler LSM modules users want?

Windows operating system provides WSL (Windows Subsystem for Linux) which allows running
CUI programs and servers which are designed for Linux. Windows users can run CUI programs
and servers without requiring real Linux kernels and can run GUI programs via Windows
kernels. Neither SELinux nor AppArmor is required for protecting programs/servers, for
antivirus software for Windows will provide protection. Then, what is an advantage of using
real Linux kernels, if we cannot allow Linux kernels to use whatever LSM modules users want?

I believe that it is time to get out of "we don't care about out-of-tree code".
The "we don't care about out-of-tree code" reasoning is a brain freeze that leads to
forget about users who still continue using Linux as platform for running their software.


  reply	other threads:[~2022-10-30  4:04 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
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 [this message]
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=53b07579-82f5-404e-5c2c-de7314fff327@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=casey@schaufler-ca.com \
    --cc=jmorris@namei.org \
    --cc=john.johansen@canonical.com \
    --cc=keescook@chromium.org \
    --cc=linux-audit@redhat.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --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;
as well as URLs for NNTP newsgroup(s).