Re: [PATCH v2 4/5] perf/amd/ibs: Avoid calling perf_allow_kernel() from the IBS NMI handler
From: Michael Petlan
Date: Mon Mar 09 2026 - 15:08:18 EST
On Mon, 9 Mar 2026, Ravi Bangoria wrote:
> Hi Michael,
>
> > By evaluating the privileges at the event-init moment and using cached
> > value later, couldn't it lead to the cached value being obsolete at
> > some point? E.g. a setuid program later dropping the privileges but
> > still being able to read physical addresses?
>
> Yes, but wouldn't the same concern apply to all other call sites of
> perf_allow_kernel() ?
Well, I don't say this case is worse than the others, just raising a
more generic question whether this design is fairly acceptable or would
deserve e.g. privilege adjusting at the time when they are dropped or
something... Nothing more, just a note... :)
Michael
>
> Thanks,
> Ravi
>
>