Skip to content

kernel.dmesg_restrict not working with journalctl #6

@evict

Description

@evict

Version: 5.0.7.a-2-hardened

When running dmesg, the following occurs when attempting to read the kernel buffer:

Ʋ dmesg                                                                   INSERT
dmesg: read kernel buffer failed: Operation not permitted

journalctl however, is not restricted from reading the buffer:

Ʋ journalctl -k
-- Logs begin at Wed 2018-11-14 13:28:42 CET, end at Thu 2019-04-25 15:13:35 CES>
Apr 23 10:48:49 UNLIGHT kernel: Linux version 5.0.7.a-2-hardened (builduser@jell>
Apr 23 10:48:49 UNLIGHT kernel: Command line: initrd=\initramfs-linux.img cryptd>
Apr 23 10:48:49 UNLIGHT kernel: KERNEL supported cpus:
Apr 23 10:48:49 UNLIGHT kernel:   Intel GenuineIntel
Apr 23 10:48:49 UNLIGHT kernel:   AMD AuthenticAMD
Apr 23 10:48:49 UNLIGHT kernel:   Hygon HygonGenuine
Apr 23 10:48:49 UNLIGHT kernel:   Centaur CentaurHauls
Apr 23 10:48:49 UNLIGHT kernel: x86/fpu: Supporting XSAV

Since systemd-journal uses the sys_admin capability, it is not restricted:

Ʋ pscap | grep journal
1     29264 root        systemd-journal   chown, dac_override,
                                dac_read_search, fowner, setgid, setuid, 
                                sys_ptrace, sys_admin, audit_control, 
                                mac_override, syslog, audit_read

Is there anyway we can restrict journalctl from accessing dmesg? The systemd project recommends removing the user from the systemd-journald group, but that does not work for my installation, as my user is not in that group.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions