Message ID | 93b5e861-c1ec-417c-b21e-56d0c4a3ae79@I-love.SAKURA.ne.jp (mailing list archive) |
---|---|
Headers | show |
Series | LSM: Officially support appending LSM hooks after boot. | expand |
On Mon, Nov 20, 2023 at 8:28 AM Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote: > > This functionality will be used by TOMOYO security module. > > In order to officially use an LSM module, that LSM module has to be > built into vmlinux. This limitation has been a big barrier for allowing > distribution kernel users to use LSM modules which the organization who > builds that distribution kernel cannot afford supporting [1]. Therefore, > I've been asking for ability to append LSM hooks from LKM-based LSMs so > that distribution kernel users can use LSMs which the organization who > builds that distribution kernel cannot afford supporting. It doesn't really matter for this discussion, but based on my days working for a Linux distro company I would be very surprised if a commercial distro would support a system running unapproved third-party kernel modules. We've talked a lot about this core problem and I maintain that it is still a disto problem and not something I'm really concerned about upstream.
On 2023/11/21 7:52, Paul Moore wrote: > On Mon, Nov 20, 2023 at 8:28 AM Tetsuo Handa > <penguin-kernel@i-love.sakura.ne.jp> wrote: >> >> This functionality will be used by TOMOYO security module. >> >> In order to officially use an LSM module, that LSM module has to be >> built into vmlinux. This limitation has been a big barrier for allowing >> distribution kernel users to use LSM modules which the organization who >> builds that distribution kernel cannot afford supporting [1]. Therefore, >> I've been asking for ability to append LSM hooks from LKM-based LSMs so >> that distribution kernel users can use LSMs which the organization who >> builds that distribution kernel cannot afford supporting. > > It doesn't really matter for this discussion, but based on my days > working for a Linux distro company I would be very surprised if a > commercial distro would support a system running unapproved > third-party kernel modules. A commercial distro does not care about problems that are caused by using kernel modules that are not included in that distro's kernels. Those who supply kernel modules that are not included in that distro's kernels (e.g. antivirus software vendors) care about problems that are caused by using such kernel modules. Kernel modules for hardware devices that are not included in that distro's kernels can be appended after boot. Kernel modules for filesystems that are not included in that distro's kernels can be appended after boot. If a commercial distro does not want to allow use of kernel modules that are not included in that distro's kernels, that distro would enforce module signature verification rather than disabling loadable module support. Keeping loadable module support enabled is a balance that is important for getting wider developers/users. > > We've talked a lot about this core problem and I maintain that it is > still a disto problem and not something I'm really concerned about > upstream. LSM modules that are not built into vmlinux currently cannot be appended after boot. Such asymmetry is strange and remains a big barrier. You are not concerned about this asymmetry, but I am very much concerned. Please give me feedback on not "I don't need it" but "how we can do it".
On Tue, Nov 21, 2023 at 8:03 AM Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote: > On 2023/11/21 7:52, Paul Moore wrote: > > On Mon, Nov 20, 2023 at 8:28 AM Tetsuo Handa > > <penguin-kernel@i-love.sakura.ne.jp> wrote: > >> > >> This functionality will be used by TOMOYO security module. > >> > >> In order to officially use an LSM module, that LSM module has to be > >> built into vmlinux. This limitation has been a big barrier for allowing > >> distribution kernel users to use LSM modules which the organization who > >> builds that distribution kernel cannot afford supporting [1]. Therefore, > >> I've been asking for ability to append LSM hooks from LKM-based LSMs so > >> that distribution kernel users can use LSMs which the organization who > >> builds that distribution kernel cannot afford supporting. > > > > It doesn't really matter for this discussion, but based on my days > > working for a Linux distro company I would be very surprised if a > > commercial distro would support a system running unapproved > > third-party kernel modules. > > A commercial distro does not care about problems that are caused by > using kernel modules that are not included in that distro's kernels. My experience has taught me otherwise. > If a commercial distro does not want to allow use of kernel modules that > are not included in that distro's kernels, that distro would enforce module > signature verification rather than disabling loadable module support. > Keeping loadable module support enabled is a balance that is important for > getting wider developers/users. We don't currently support LSMs as dynamically loadable kernel modules and if the only reasons for doing so are either to A) support out-of-tree LSMs or B) avoid having to recompile a kernel (to hack an unsupported LSM into a distro kernel) I have to say (yet again) that I am not interested. > > We've talked a lot about this core problem and I maintain that it is > > still a disto problem and not something I'm really concerned about > > upstream. > > LSM modules that are not built into vmlinux currently cannot be appended > after boot. Such asymmetry is strange and remains a big barrier. > > You are not concerned about this asymmetry, but I am very much concerned. > Please give me feedback on not "I don't need it" but "how we can do it". I thought my feedback has been clear up to this point, but perhaps I need to be more direct. At this point in time I am not interested in supporting dynamically loaded LSM kernel modules if the only reasons are to support out-of-tree LSMs or users who want to hack unsupported LSMs into pre-built distro kernels; both of these use cases can be solved today by compiling your own kernel. As with the other threads involving this topic, I'm going to refrain from any further comments until I see a new discussion point. -- paul-moore.com
On 2023/11/22 13:41, Paul Moore wrote:
> both of these use cases can be solved today by compiling your own kernel.
No. Compiling kernels is not a viable option for regular developers/users.
We (who are kernel developers) tend to think that compiling/replacing a
kernel as a trivial thing. But majority of Linux users do not think so.
The kernel is one of most puzzling programs for Linux users, and most of
Linux users afraid compiling/replacing kernels.
Red Hat's support said that Red Hat does not support a rebuilt RHEL kernel
even if that kernel is rebuilt using the same kernel source and the same
kernel config shipped by Red Hat. Let alone kernels which are rebuilt with
the modified kernel config.
Your "compiling your own kernel" answer is asking me to become a Linux
distributor and to support the whole rebuilt kernels. That will include
management of kernel-debuginfo packages needed for analyzing vmcore, and
also management of userspace packages which depend on the kernel package.
What do you think if you are obligated to support whatever problems just because
you want to allow users to use your code? I'm sure that you will say "I can't".
Your answer cannot be satisfied by a kernel developer who can develop/support
an LSM module but cannot afford supporting problems that are irrelevant to
that LSM module.
Being able to use whatever functionality (not only LSM modules but also
device drivers and filesystem drivers) using pre-built distribution kernels
and pre-built kernel-debuginfo packages is the mandatory baseline.
Of course, the best solution is that whatever LSM modules are built into
distributor's kernels. But since such solution is impossible
( https://bugzilla.redhat.com/show_bug.cgi?id=542986 ), the second best
solution will be that distributor's kernels support only ability to load LSM
modules which that distributor's kernels cannot afford supporting as loadable
kernel modules, and somebody else other than distributor provides support for
LSM modules which that distributor's kernels cannot afford supporting.