Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: The daemon reports: No process capabilities; relying on RLIMIT_MEMLOCK to lock memory Failed to lock memory pages (secrets may be swapped to disk): Cannot allocate memory (os error 12) Version-Release number of selected component (if applicable): Fedora 45 COSMIC oo7 0.7.0 beta (e91b98a) systemd 262.1 oo7 running as a systemd user service How reproducible: Happens allways on startup Steps to Reproduce: 1.Just boot and check oo7 daemon messages Actual results: No side effects detected but if pages are ever swapped they are vulnerable to atacks Expected results: oo7 should be able to lock pages in memory for sensible data I understand this is a goal that is being prevented by the way the service is defined (at least on Fedora 45) Additional info: I checked the effective limits and memory usage of the running daemon. Process limits: Max locked memory 8388608 8388608 bytes systemd reports: LimitMEMLOCK=8388608 LimitMEMLOCKSoft=8388608 Process capabilities: CAP_IPC_LOCK is present in the bounding set, but absent from both the effective and permitted capability sets. Memory usage: VmPeak: 496400 kB VmSize: 496388 kB VmLck: 0 kB VmRSS: 13532 kB VmData: 22672 kB As expected, no memory is currently locked (VmLck: 0 kB). The system uses zram for swap: NAME TYPE SIZE USED PRIO /dev/zram0 partition 8G 0B 100 No swap space was in use when these measurements were taken. Questions: Is using mlockall(MCL_CURRENT | MCL_FUTURE) intentional, so that the entire daemon process (including future memory allocations) must be locked? What RLIMIT_MEMLOCK value is actually recommended for oo7? Is granting CAP_IPC_LOCK the intended solution, or should the systemd service use a different configuration? Would it be preferable to lock only the memory regions containing sensitive data rather than the entire process address space? I have not changed the service configuration or increased the memory-locking limit. I would prefer to follow the recommended security configuration rather than grant additional privileges or impose an unlimited memory-locking limit without understanding the requirements.
Confirmed that this issue remains present in oo7-0.7.2-1.fc45, installed from updates-testing. Environment: - Fedora Workstation 45, x86_64 - GNOME Shell 51.1 - Kernel 7.3.4-300.fc45.x86_64 - oo7-daemon, oo7-portal and pam_oo7: 0.7.2-1.fc45 Both memory-locking warnings continue to appear at daemon startup. Process measurements: ``` VmSize: 1848056 kB VmLck: 0 kB VmRSS: 13092 kB VmSwap: 0 kB CapEff: 0000000000000000 ``` Systemd resource limits: ``` LimitMEMLOCK=8388608 LimitMEMLOCKSoft=8388608 AmbientCapabilities= ``` The executable `/usr/libexec/oo7-daemon` has no file capabilities. The system has 32 GiB of physical RAM, approximately 17.5% memory utilization, and no swap utilization at the time of testing. No service configuration, resource limits or capabilities have been modified. This confirms that the reported behavior persists in version 0.7.2 and is also reproducible under GNOME.
Thanks for the report. For now I don't think this is a "problem" per se, and that would be confirmed by oo7 just logging warnings here rather than existing with an error state, but it would be "nice" to avoid this issue and have oo7 fully work as intended. Reading through the relevant source code of oo7 [0] and the mlockall manual page [1], the error returned by "mlockall" would indicate that oo7 tries to lock more pages than the current default limit ("ulimit -l" returns 8192 on my system, i.e. 8MiB) - I don't know if we should give oo7-daemon the necessary capabilities to circumvent this limit or not, or if that limit can be raised for oo7 somehow. [0]: https://github.com/linux-credentials/oo7/blob/0.7.3/server/src/capability.rs#L129-L134 https://github.com/linux-credentials/oo7/blob/0.7.3/server/src/capability.rs#L165-L175 [1]: https://sourceware.org/glibc/manual/latest/html_node/Page-Lock-Functions.html#index-mlockall