5.10.4+ now restricts kernel log access

Tried accessing kernel logs after 5.10.5-zen update with dmesg and got this.

dmesg: read kernel buffer failed: Operation not permitted

New default for kernel.dmesg_restrict is the reason, for both linux and linux-zen.

# CONFIG_SECURITY_DMESG_RESTRICT is not set
CONFIG_SECURITY_DMESG_RESTRICT=y

Annoying have to type in long root password for each dmesg use, seeing the potential security threat for this is so low for a home user.

Easy to reset though, if you feel the same way.

sudo sysctl kernel.dmesg_restrict=0

And persist this setting across boots.

echo 'kernel.dmesg_restrict=0' | sudo tee -a /etc/sysctl.d/99-sysctl.conf
5 Likes

that been more than 2 years that dmesg need sudo …

6 Likes

nope, Arch only adapted that kernel config change now:
https://bbs.archlinux.org/viewtopic.php?id=262222

the actual commit: https://github.com/archlinux/svntogit-packages/commit/b78bc292e2218661a3b70163ec30711c87100941#diff-3e341d2d9c67be01819b25b25d5e53ea3cdf3a38d28846cda85a195eb9b7203a

2 Likes

You can try journalctl -k if your user is a member of a privileged group. To quote man journalctl:

Members of the groups “systemd-journal”, “adm”, and “wheel” can read all journal files. Note that the two latter groups traditionally have additional privileges specified by the distribution. Members of the “wheel” group can often perform administrative tasks.

2 Likes

What are you talking about?

I even included the github commit changing the default from not set to restricted, @BS86 included a forum thread.

The setting may have been available for years, but it was not enabled in Arch by default.

IMHO this is overkill for a home users, and particularly annoying with a lengthy root password, others opinions may differ