Re: [tip:perf/core] [perf/core] 166f10836a: perf-sanity-tests.Object_code_reading.fail

From: Namhyung Kim

Date: Thu Jul 16 2026 - 14:39:09 EST


Hello,

Thanks for taking a look.

On Thu, Jul 16, 2026 at 02:29:49PM +0800, Mi, Dapeng wrote:
>
> On 7/10/2026 4:41 PM, Oliver Sang wrote:
> > hi, Dapeng,
> >
> > On Thu, Jul 09, 2026 at 05:04:11PM +0800, Mi, Dapeng wrote:
> >> Hi Oliver,
> >>
> >> It looks the direct reason causing the test case failure is the "0" sampled
> >> IP. This is expected. The commit 166f10836a653dfa280d4335603b52f685b8b1ef
> >> ("perf/core: Fix kernel register info leak via hardware skid") mitigates a
> >> security hole and may lead to the sampled IP could be 0. 
> >>
> >> What user right is used to run this command, root or normal user? If it's a
> > root user. as 'sudo' in attached:
> >
> > "2026-07-10 15:38:50 sudo ASAN_OPTIONS=fast_unwind_on_malloc=0 /usr/src/linux-perf-x86_64-rhel-9.4-bpf-166f10836a653dfa280d4335603b52f685b8b1ef/tools/perf/perf test 23 -vvv"
> >
> >> root user, suppose it should not generate such kind of error. Could you
> >> please add "-vvv" option and rerun this test? The "-vvv" option would print
> >> more  verbose log.
> > as attached, thanks
>
> "
>
>   disabled                         1
>   inherit                          1
>   *exclude_kernel                   1*
>   exclude_hv                       1
>   mmap                             1
>
> "
>
> The event "exclude_kernel" attribute is set in the test case,  so it's
> possible that perf overwrites the kernel IP to 0 to prevent kernel IP
> leakage if PMI hits into kernel space. 

I expect PMU doesn't hit samples in the kernel when exclude_kernel is
set. But maybe there are some corner cases.

>
> In general, the "exclude_kernel" attribute should not be set for root user,
> I have no idea why "exclude_kernel" is set in this case.

The test explicitly runs with it both for hardware and software events.
I think it wants to check the privilege filter as well.

>
> Anyway, we could have to improve this test case and skip these "0" sample IPs.

Yep, probably that's the simplest fix.

Thanks,
Namhyung