lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y4sOAAJPivaLNzt/@mailbox.org>
Date:   Sat, 3 Dec 2022 09:51:12 +0100
From:   Stefan Bavendiek <stefan.bavendiek@...lbox.org>
To:     kernel-hardening@...ts.openwall.com
Cc:     linux-hardening@...r.kernel.org
Subject: Re: Reducing runtime complexity

On Fri, Dec 02, 2022 at 12:13:48PM -0800, Kees Cook wrote:
> On Fri, Dec 02, 2022 at 07:31:06AM +0100, Stefan Bavendiek wrote:
> > On Thu, Dec 01, 2022 at 03:21:37PM -0800, Kees Cook wrote:
> > > On Thu, Dec 01, 2022 at 09:09:04PM +0100, Stefan Bavendiek wrote:
> > > > Some time ago I wrote a thesis about complexity in the Linux kernel and how to reduce it in order to limit the attack surface[1].
> > > > While the results are unlikely to bring news to the audience here, it did indicate some possible ways to avoid exposing optional kernel features when they are not needed.
> > > > The basic idea would be to either build or configure parts of the kernel after or during the installation on a specific host.
> > > > 
> > > > Distributions are commonly shipping the kernel as one large binary that includes support for nearly every hardware driver and optional feature, but the end user will normally use very little of this.
> > > > In comparison, a custom kernel build for a particular device and use case, would be significantly smaller. While the reduced complexity won't be directly linked with reduction in attack surface, from my understanding the difference would make a relevant impact.
> > > > 
> > > > The question I keep wondering about is how feasible this is for general purpose distributions to have the kernel "rebuild" in this way when it is installed on a particular machine.
> > > 
> > > Much of the functionality is modules, so once a system is booted and
> > > running the expected workloads, one can set the modules_disabled sysctl
> > > and block everything else from being loaded.
> > > 
> > > -Kees
> > > 
> > > -- 
> > > Kees Cook
> > 
> > Disableing modules in general will prevent quite a lot of functionality that would still be expected to work, like plugging in a usb device.
> > One approach may be to load everything that may possibly be required in the future as well based on the use case of the specific system and then disable loading additional modules, but that does not seem like a good solution either.
> > 
> > Perhaps exploring embedded device deployments is an idea, but in general the idea is to ship a smaller kernel to something like Linux desktops without limiting functionality that likely to be required.
> 
> What I mean is that we already have a good middle-ground. It doesn't
> need to be all (general distro) or nothing (embedded build). Once the
> workload for the system is known, load the needed modules and block
> everything else. i.e. set up a module alias named "disable", and then
> fill /etc/modules with whatever you might want that isn't automatically
> loaded at boot and end the list with "disable". I wrote this up almost
> exactly 10 years ago:
> 
> https://outflux.net/blog/archives/2012/11/28/clean-module-disabling/
> 
> :)
> 
> -Kees
> 
> -- 
> Kees Cook

This does look quite similar to what I had in mind.
Thank you for the response.

- Stefan

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ