Re: ftrace_kill() leads to kmalloc-512 UAF

From: Steven Rostedt
Date: Wed Jul 20 2022 - 11:40:26 EST


On Wed, 20 Jul 2022 18:22:25 +0300
Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:

> Basically, if ftrace_kill() is ever called ever there is a ticking UAFbomb.

That's because ftrace_kill() means something horribly went wrong, and
because ftrace modifies the kernel text, it shuts everything down and this
needs to be fixed.

The fix is not to have something handle ftrace_kill(), it's to fix the
situation so that ftrace_kill() is not called.

Hmm, perhaps we should add an option to make ftrace_kill() call BUG().

I'll go back and take a look at your analysis.

Thanks,

-- Steve