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

Guilherme G. Piccoli
2026-04-01T22:28:30Z

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