Re: [PATCH v2] kref: Avoid null pointer dereference after WARN

From: Andi Kleen
Date: Tue Jun 27 2017 - 15:48:20 EST


> Targeting things in /proc/sys via confused privileged helpers is
> extremely common. See Chrome OS pwn2own exploits (targetting modprobe
> sysctl), and plenty of others. Modern attack methodology is rarely a

Ok.

> single-bug attack, but rather a chain of bugs, which may include
> producing or exploiting weak userspace configurations to soften the
> kernel.
>
> Regardless, it's a fair point that checking this unconditionally is
> wasteful. Strangely this doesn't help:

I doubt the runtime overhead is significant. The main issue I would
see is that kernels crash more often.

But if the issue doesn't really happens that often it
probably doesn't matter (apart from kernel size, which
has been resolved)

Too bad we don't have kerneloops.org data left, so it's hard
to check data on this.

However I still think you would get more leverage out of generic
bug/panic_on_warn sysctls

-Andi