Kernel: Yama, Security, and LRU
-
Russell Coker: Yama
I’ve just setup the Yama LSM module on some of my Linux systems. Yama controls ptrace which is the debugging and tracing API for Unix systems. The aim is to prevent a compromised process from using ptrace to compromise other processes and cause more damage. In most cases a process which can ptrace another process which usually means having capability SYS_PTRACE (IE being root) or having the same UID as the target process can interfere with that process in other ways such as modifying it’s configuration and data files. But even so I think it has the potential for making things more difficult for attackers without making the system more difficult to use.
If you put “kernel.yama.ptrace_scope = 1” in sysctl.conf (or write “1” to /proc/sys/kernel/yama/ptrace_scope) then a user process can only trace it’s child processes. This means that “strace -p” and “gdb -p” will fail when run as non-root but apart from that everything else will work. Generally “strace -p” (tracing the system calls of another process) is of most use to the sysadmin who can do it as root. The command “gdb -p” and variants of it are commonly used by developers so yama wouldn’t be a good thing on a system that is primarily used for software development.
Another option is “kernel.yama.ptrace_scope = 3” which means no-one can trace and it can’t be disabled without a reboot. This could be a good option for production servers that have no need for software development. It wouldn’t work well for a small server where the sysadmin needs to debug everything, but when dozens or hundreds of servers have their configuration rolled out via a provisioning tool this would be a good setting to include.
-
Secret Memory Areas For Linux Might Finally Be Ready With memfd_secret
In development for more than one year has been the ability to create secret memory areas on Linux that would be visible only to the owning process and is not mapped for other processes or the kernel page tables. That "memfd_secret" system call has finally materialized in Linux-Next and looking like it could be ready for mainline.
The memfd_secret system call is the new interface for creating secret memory areas on Linux for use-cases like OpenSSL in user-space for storing private keys and reducing the chances they are potentially exposed while in system memory and not backed by any other hardware encryption methods.
-
Multigenerational LRU Code Updated For Enhancing Linux Kernel Performance
Last month Google engineers proposed multi-generational LRU for Linux to enhance the kernel performance and today the work has advanced to a second version.
Google's Yu Zhao announced the "v2" of the multigenerational LRU framework today for the Linux kernel. The key takeaway from this work remains: "The current page reclaim is too expensive in terms of CPU usage and often making poor choices about what to evict. We would like to offer an alternative framework that is performant, versatile and straightforward."
As noted in the original article on the matter, the multi-generational LRU code in its preliminary form was found to yield ~18% fewer low-memory kills on Android, reducing cold starts by 16%, on Chrome OS there were ~96% fewwer low-memory tab discards and 59% fewer out-of-memory kills on fully-utilized devices. Google's testing found a "significant reduction" in CPU usage with this proposed multi-generational LRU (Least Recently Used) framework.
-
- Login or register to post comments
Printer-friendly version
- 1734 reads
PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
digiKam 7.7.0 is released
After three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release.
| Dilution and Misuse of the "Linux" Brand
|
Samsung, Red Hat to Work on Linux Drivers for Future Tech
The metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world.
Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility.
| today's howtos
|
Recent comments
48 weeks 6 days ago
48 weeks 6 days ago
48 weeks 6 days ago
49 weeks 4 hours ago
49 weeks 4 hours ago
49 weeks 7 hours ago
49 weeks 7 hours ago
49 weeks 19 hours ago
49 weeks 19 hours ago
49 weeks 19 hours ago