Thanks Aneesh and Mpe for reviewing this patch.

Michael Ellerman <m...@ellerman.id.au> writes:

> "Aneesh Kumar K.V" <aneesh.ku...@linux.ibm.com> writes:
[snip]
>>>   
>>> +   /* Allow access only to perfmon capable users */
>>> +   if (!perfmon_capable())
>>> +           return -EACCES;
>>> +
>>
>> An access check is usually done in open(). This is the read callback IIUC.
>
> Yes. Otherwise an unprivileged user can open the file, and then trick a
> suid program into reading from it.

Agree, but since the 'open()' for this sysfs attribute is handled
by kern-fs, AFAIK dont see any direct way to enforce this policy.

Only other way it seems to me is to convert the 'perf_stats' DEVICE_ATTR_RO
to DEVICE_ATTR_ADMIN_RO.

>
> cheers

-- 
Cheers
~ Vaibhav
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-le...@lists.01.org

Reply via email to