Re: [PATCH] pstore/ftrace: Factor KASLR offset in the core kernel instruction addresses

From: Guilherme G. Piccoli

Date: Wed Apr 01 2026 - 18:38:07 EST


On 31/03/2026 18:48, Kees Cook wrote:
> [...]
>> /* This doesn't need to be atomic: speed is chosen over correctness here. */
>> static u64 pstore_ftrace_stamp;
>> +unsigned long kaslr_off;
>
> This should at least be "static", but why have it sitting in the data
> segment at all, only to be scraped out by attackers with a arbitrary read
> primitives? Can we just call kaslr_offset() directly as needed instead
> (it's already an inline)?
>
> -Kees
>

Hi Kees, thanks for the review!

Totally feasible - I thought in some form of optimization, since it's
tracing, but if you think doesn't worth, I can easily just put the call
to kaslr_offset() there, as I did in my internal V0 heh

I can try some perf measurements, let's see how it goes ...
Cheers,


Guilherme