Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • How can root overwrite kernel memory? Commented Nov 10 at 13:42
  • 2
    @StephenKitt init_module(2) with a really minimal module, or kexec_load(2) your own kernel, or, if enabled in the kernel, mknod'ing /dev/mem and writing to it, or by opening /sys/bus/pci/devices/…/resource{N} of a DMA-capable device (NIC!) and making it do DMA operations on kernel memory Commented Nov 10 at 14:22
  • 4
    well, I secureboot a kernel (I'm too lazy to do measured boot on my laptop, but in principle I could), so that's verified at boot. I could still open /dev/mem on that Fedora machine. That's what I meant with "unless you really specify what your "etc" means": verified at boot does not imply restrained root. It just means that if all processes run as root are trustworthy (and so is the kernel and its modules), then the system is "intact". Now, OPs question seems to imply "assuming I have a misbehaving super user", and that's not covered by boot-time attestation. Commented Nov 10 at 17:12
  • 5
    No. Since root can overwrite kernel memory That does ignore the possibility of configuring an SE Linux-based RBAC system that could prevent root from reading kernel memory. Good luck getting such a system configured and running, nevermind maintaining it - I've actually been involved in efforts that tried... Commented Nov 10 at 18:29
  • 1
    @MarcusMüller Actually, Fedora runs with the "lockdown" feature enabled (man kernel_lockdown), whose goal is to stop root from arbitrarily tampering with the kernel (when under UEFI secure boot). That'll stop root from loading arbitrary modules, unless they have access to an enrolled private key to sign them. And the DMA attacks will be stopped by the IOMMU on anything halfway modern (and properly configured). Commented Nov 11 at 13:49