Skip to content

Run PowerJoular on Intel/AMD Linux without root/sudo #1

Description

@adelnoureddine

Access to RAPL data is restricted in Linux kernel to only privileged users (sudo/root), in order to avoid the PLATYPUS vulnerability.

To avoid running PowerJoular with sudo or root, a proposed approach is to set RAPL files to read for all users. Read status is reset on reboot, so the proposition is to add this right to /etc/sysfs.conf : mode class/powercap/intel-rapl:0/energy_uj = 0444.

In PowerJoular, we read 2 files for each RAPL domain: name and energy_uj. Both files need to have read rights.

Mainly theses files (if they exist):

/sys/class/powercap/intel-rapl/intel-rapl:1/energy_uj
/sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj
/sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:2/energy_uj
/sys/class/powercap/intel-rapl/intel-rapl:1/name
/sys/class/powercap/intel-rapl/intel-rapl:0/name
/sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:2/name

If you only use the PowerJoular systemd service, which needs to be enabled and run as root/sudo as all systemd services, then you can keep your system unchanged as the service will run with privileged rights and writes data to /tmp folder as we explained in the project's page.

  • Add workaround for sysfs.conf in documentation page & readme
  • Add a script or simpler documentation to change permissions for RAPL file on boot for sysf.conf.

Metadata

Metadata

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions