Re: [PATCH V3 2/2] perf/x86: Reset the dirty counter to prevent the leak for an RDPMC task

From: Liang, Kan
Date: Tue Apr 13 2021 - 21:31:01 EST




On 4/13/2021 8:34 PM, Andy Lutomirski wrote:
On Tue, Apr 13, 2021 at 12:05 PM <kan.liang@xxxxxxxxxxxxxxx> wrote:

From: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>

The counter value of a perf task may leak to another RDPMC task.
For example, a perf stat task as below is running on CPU 0.

perf stat -e 'branches,cycles' -- taskset -c 0 ./workload

I assume this doesn't fix the leak if the sensitive counter is systemwide?


Right.

Could Intel please add proper security and ideally virtualization for
this? Ideally RDPMC permission would be a bitmask for all RDPMC-able
counters, not just a single on/off switch.


Yes, we are working on it.

For now, I think this patch is what we can do so far.

Thanks,
Kan