Re: [LTP] [PATCH v5] rfim: add new test for verifying RFIM sysfs interface

Andrea Cervesato via ltp <[email protected]> Thu, 30 Jul 2026 11:46:44 +0000
Newsgroups it.linux.lists.ltp
Message-ID <[email protected]>
Hi Piotr,

sorry for the delay.

> +/*\
> + * Validate presence and permissions of RFIM attributes.
> + * The kernel exposes the dvfs, fivr and dlvr attribute groups
> + * independently, gated on per-device feature bits, so the test checks
> + * whichever of the three groups the hardware presents.
> + *
> + * Permissions are verified by opening each node: read-only attributes
> + * must accept O_RDONLY and reject a write open, while read-write ones
> + * must accept O_RDWR. For sysfs nodes the mode bits alone are not
> + * authoritative - the kernel can still refuse the open in the file's
> + * own syscall handler - so open() is what actually exercises access.

Pleae use :manpage:`open(2)` and `O_RDONLY` and `O_RDWR`.

> + *
> + * The test requires root because the read-write RFIM attributes are
> + * root-owned and created mode 0644, so only the owner holds the write
> + * bit. An unprivileged user could read them but would get EACCES when
> + * opening them O_RDWR, which the read-write check would misreport as a

Same here for EACCESS and O_RDWR.

In this way we will have a certain consistency inside LTP documentation.

The rest looks ok.

Reviewed-by: Andrea Cervesato <[email protected]>

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp