Re: Taint addresses

From: Luck, Tony
Date: Thu May 26 2022 - 12:41:12 EST


On Thu, May 26, 2022 at 02:11:12PM +0200, Borislav Petkov wrote:
> I guess something like this:
>
> ...
> [ 2.591532] x86/mm: Checked W+X mappings: passed, no W+X pages found.
> [ 2.592678] CPU: 2 PID: 1 Comm: swapper/0 Tainted: G S C 5.18.0+ #7
> [ 2.593079] Last taint addresses:
> [ 2.593079] S:start_kernel+0x614/0x634
> [ 2.593079] C:kernel_init+0x70/0x140

Maybe something a little more user friendly than addresses?

If there was a new macro:

#define add_taint(flag, lockdep) __add_taint(flag, lockdep, __FILE__, __LINE__)

then renmame existing add_taint() to __add_taint() and have it save the
file/line values.

Then you could print filename:line

Also: Is it more useful to store the most recent taint of each type,
or the first of each type?

-Tony