Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 2 Oct 2021 19:33:17 +0300
From: Alexander Popov <>
To: Steven Rostedt <>
Cc: Linus Torvalds <>,
 Petr Mladek <>, "Paul E. McKenney" <>,
 Jonathan Corbet <>, Andrew Morton <>,
 Thomas Gleixner <>, Peter Zijlstra <>,
 Joerg Roedel <>, Maciej Rozycki <>,
 Muchun Song <>,
 Viresh Kumar <>, Robin Murphy <>,
 Randy Dunlap <>, Lu Baolu <>,
 Kees Cook <>, Luis Chamberlain <>,
 Wei Liu <>, John Ogness <>,
 Andy Shevchenko <>,
 Alexey Kardashevskiy <>,
 Christophe Leroy <>, Jann Horn
 <>, Greg Kroah-Hartman <>,
 Mark Rutland <>, Andy Lutomirski <>,
 Dave Hansen <>, Will Deacon
 <>, David S Miller <>,
 Borislav Petkov <>,
 Kernel Hardening <>,,
 "open list:DOCUMENTATION" <>,
 Linux Kernel Mailing List <>,
Subject: Re: [PATCH] Introduce the pkill_on_warn boot parameter

On 02.10.2021 15:13, Steven Rostedt wrote:
> On Sat, 2 Oct 2021 14:41:34 +0300
> Alexander Popov <> wrote:
>> Currently, the Linux kernel provides two types of reaction to kernel warnings:
>>  1. Do nothing (by default),
>>  2. Call panic() if panic_on_warn is set. That's a very strong reaction,
>>     so panic_on_warn is usually disabled on production systems.
>> >From a safety point of view, the Linux kernel misses a middle way of handling  
>> kernel warnings:
>>  - The kernel should stop the activity that provokes a warning,
>>  - But the kernel should avoid complete denial of service.
>> >From a security point of view, kernel warning messages provide a lot of useful  
>> information for attackers. Many GNU/Linux distributions allow unprivileged users
>> to read the kernel log (for various reasons), so attackers use kernel warning
>> infoleak in vulnerability exploits. See the examples:
>> Let's introduce the pkill_on_warn parameter.
>> If this parameter is set, the kernel kills all threads in a process that
>> provoked a kernel warning. This behavior is reasonable from a safety point of
>> view described above. It is also useful for kernel security hardening because
>> the system kills an exploit process that hits a kernel warning.
> How does this help? It only kills the process that caused the warning,
> it doesn't kill the process that spawned it. This is trivial to get
> around. Just fork a process, trigger the warning (it gets killed) and
> then read the kernel log.
> If this is your rationale, then I'm not convinced this helps at all.

Steven, as I understand, here you ask about the security implications of
pkill_on_warn (not about the safety implications that I mentioned).

Killing the exploit process that hit a warning is MUCH better than ignoring and
proceeding with execution. That may influence the stability of the exploits that
hit WARN_ON() or rely on WARN_ON() infoleak.

Exploit development is the constant struggle for attack stability. Exploiting a
heap memory corruption is especially painful when the kernel works with the
attacked slab caches in parallel with your exploit.

So when the kernel kills the exploit process, some of the WARN_ON() infoleak
data becomes obsolete; the attacker loses the execution in that particular
kernel task on that particular CPU. Moreover, restarting the exploit process
would bring a lot of noise to the system. That may decrease the attack stability
even more.

So killing the exploit process is the best option that we have here to distress
the attacker who uses the WARN_ON() infoleak technique. I.e. that is
probabilistic attack mitigation, which is reasonable for kernel safety as well.

I hope I managed to show this from the attacker's side.

Best regards,

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.