The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>, Breno Leitao <leitao@debian.org>,
	corbet@lwn.net, skhan@linuxfoundation.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, gregkh@linuxfoundation.org
Subject: Re: [PATCH] killswitch: add per-function short-circuit mitigation primitive
Date: Mon, 11 May 2026 19:05:29 -0400	[thread overview]
Message-ID: <agJguTdMd95_rNGp@laps> (raw)
In-Reply-To: <20260511153158.bad58633e2c8d247322ebb4b@linux-foundation.org>

On Mon, May 11, 2026 at 03:31:58PM -0700, Andrew Morton wrote:
>On Mon, 11 May 2026 15:07:51 +0200 Michal Hocko <mhocko@suse.com> wrote:
>
>> > 2) It's common to run hundreds of different kernel versions across a
>> >    fleet. Since livepatch is kernel-specific, a single CVE suddenly
>> >    requires building and deploying hundreds of individual livepatches—
>> >    far less practical than a simple sysfs write.
>>
>> LP is certainly a more laborous solution.
>
><another please-educate-akpm email>
>
>Does a livepatch *have* to be distributed as a ready-to-load kernel
>module?
>
>Is it not possible to distribute a "livepatch" to the fleet as a single
>string?  Send out "make function some_bad_function() return -EINVAL"
>and let scripting on each machine figure out how to locally write,
>build, sign and install such a livepatch?
>
>That would require that each machine locally contains enough data for
>it to be able to build a kernel for the currently-running kernel, and
>that each machine contains a build environment.

So we'll need to have a kernel build env, the sources for the current kernel,
debug info, and some sort of a semantic patch (.cocci?) to make the
transformation. I think we could even script all of that per-distro, yes.

>I *think* this is feasible on distro-based machines?  But perhaps not
>on stripped-down hyperscalar boxen?

Few concerns:

1. Tiny/embedded machines that will have a really hard time building a kernel
either because of storage, CPU power, etc... Consider something like your home
router running OpenWRT.

Actually, this is a good example for a killswitch too I think. I went digging
for issues that would affect OpenWRT routers, and
https://www.cve.org/CVERecord?id=CVE-2024-1086 is a good example: OpenWRT
supports user namespaces to allow containers to run on the router, so any
container could then compromise the router.

There's no way to build kernel modules on the router - no toolchain nor storage.

With killswitch, you could simply do something like:

   echo "engage nft_verdict_init -1" > /sys/kernel/security/killswitch/control

Which, if I understand the code correctly, would disable us from adding any new
netfilter rules, but existing rules would keep working (and on most routers the
rules are fairly static).

2. Having to install a build env is not only wasteful but also not secure. For
example, a certain hyperscaler we both know does not allow compilers on
production machines. It's probably a good practice for regular distro based
machines too.

3. With secure boot a user can't load their own unsigned modules, so the user
will need to spin their own kernel and enroll their keys. Having to turn off
secure boot is a really bad solution too.

4. Nightmare as far as reproducibility goes: think of all the odd
compiler/toolchain/etc combos you'll encounter. No way to track what went
wrong, where, and how.

-- 
Thanks,
Sasha

      parent reply	other threads:[~2026-05-11 23:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07  7:05 [PATCH] killswitch: add per-function short-circuit mitigation primitive Sasha Levin
2026-05-07 10:47 ` Greg KH
2026-05-07 13:40   ` Sasha Levin
2026-05-07 16:23     ` Greg KH
2026-05-07 15:21 ` Jonathan Corbet
2026-05-08 13:44   ` Sasha Levin
2026-05-08 15:40 ` Joshua Peisach
2026-05-08 15:48   ` Mathieu Desnoyers
2026-05-08 16:13     ` Sasha Levin
2026-05-08 16:18       ` Mathieu Desnoyers
2026-05-08 16:23         ` Sasha Levin
2026-05-08 16:26           ` Mathieu Desnoyers
2026-05-08 16:54             ` Sasha Levin
2026-05-08 20:56 ` Andrew Morton
2026-05-08 21:47   ` Sasha Levin
2026-05-08 23:49     ` Andrew Morton
2026-05-09  0:15       ` Sasha Levin
2026-05-09  0:36         ` Andrew Morton
2026-05-11 11:41     ` Breno Leitao
2026-05-11 13:07       ` Michal Hocko
2026-05-11 13:39         ` Sasha Levin
2026-05-11 13:49           ` Michal Hocko
2026-05-11 13:56             ` Sasha Levin
2026-05-11 14:25               ` Michal Hocko
2026-05-11 15:55                 ` Sasha Levin
2026-05-11 16:10                   ` Michal Hocko
2026-05-11 16:45                     ` Sasha Levin
2026-05-11 17:10                       ` Michal Hocko
2026-05-11 18:09                         ` Sasha Levin
2026-05-11 13:40         ` Breno Leitao
2026-05-11 22:31         ` Andrew Morton
2026-05-11 23:01           ` Song Liu
2026-05-11 23:05           ` Sasha Levin [this message]

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=agJguTdMd95_rNGp@laps \
    --to=sashal@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=leitao@debian.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=skhan@linuxfoundation.org \
    /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