Re: [PATCH] x86/microcode: allow non-root reading of microcode version and processor flags

From: Jacek Tomaka
Date: Sun Aug 26 2018 - 08:40:03 EST



> On 26 Aug 2018, at 7:52 pm, Boris Petkov <bp@xxxxxxxxx> wrote:
>
>> On August 25, 2018 6:50:39 AM GMT+03:00, Jacek Tomaka <jacekt@xxxxxxxxx> wrote:
>> /sys/devices/system/cpu/cpuX/microcode
>>
>> Before:
>> -r-------- processor_flags
>> -r-------- version
>>
>> After:
>> -r--r--r-- processor_flags
>> -r--r--r-- version
>>
>> Microcode version has been already readable for non root users via
>> /proc/cpuinfo. However it is easier to access it from
>> /sys/devices/system/cpu/cpuX/microcode/version
>
> Easier than /proc/cpuinfo?! Sorry, not really.

Why not?

> You'd need to elaborate in greater detail what exactly you're trying to achieve.

I am trying to get microcode version from user space. Reading it from /proc/cpuinfo requires greping/awking to extract the bits of information that are readily available in microcode/version.

Any reason why the same piece of information has different access permissions, depending on the way it is accessed?

Regards.
Jacek Tomaka