Bug 33771 - Set kernel config option CONFIG_SECURITY_DMESG_RESTRICT=y by default
Summary: Set kernel config option CONFIG_SECURITY_DMESG_RESTRICT=y by default
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Kernel and Drivers maintainers
QA Contact: Sec team
URL:
Whiteboard:
Keywords: FOR_RELEASENOTES10
: 33987 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-11-15 20:02 CET by Jani Välimaa
Modified: 2025-02-05 15:36 CET (History)
3 users (show)

See Also:
Source RPM: kernel-6.6.61-1.mga10.src.rpm
CVE:
Status comment:


Attachments

Description Jani Välimaa 2024-11-15 20:02:10 CET
Setting CONFIG_SECURITY_DMESG_RESTRICT=y by default would avoid kernel memory address exposures via dmesg [1][2].

It means also that unprivileged users can't use dmesg anymore without su or sudo.

If users want to configure their system to keep the current behavior, they can use sysctl. For example:
# echo 'kernel.dmesg_restrict = 0' > /etc/sysctl.d/90-security.conf

[1] https://kspp.github.io/Recommended_Settings
[2] https://www.kernel.org/doc/html/latest/admin-guide/sysctl/kernel.html#dmesg-restrict
Comment 1 Jani Välimaa 2024-11-15 20:03:12 CET
There's also a good forum post about the matter in Clear Linux forums:
https://community.clearlinux.org/t/change-to-using-dmesg-enabling-config-security-dmesg-restrict/739/1
Comment 2 Lewis Smith 2024-11-17 20:20:24 CET
This seems a good idea. I always thought it advisable for journalctl also.
It probably warrants an update message informing users of the change.

Assigning to kernel.

Assignee: bugsquad => kernel
CC: (none) => ghibomgx

Comment 3 Giuseppe Ghibò 2024-11-19 22:13:43 CET
This has been enabled in 6.6.62-1.mga10. Now you get:

dmesg: read kernel buffer failed: Operation not permitted

Maybe we should just remind in mga10's Release_Notes wiki the above suggestion about kernel.dmesg_restrict=0.
Comment 4 Jani Välimaa 2024-11-21 16:54:50 CET
We should probably also advice that users in groups 'adm', 'systemd-journal', and 'wheel' can use 'journalctl -k' to show kernel messages.

According to Arch Linux forum [1] 'journalctl -ko short-monotonic --no-hostname' is quite close to 'dmesg' output.

[1] https://bbs.archlinux.org/viewtopic.php?pid=1947018#p1947018
Morgan Leijström 2024-11-21 18:05:37 CET

Keywords: (none) => FOR_RELEASENOTES10
CC: (none) => fri

Comment 5 sturmvogel 2025-02-05 15:36:27 CET
*** Bug 33987 has been marked as a duplicate of this bug. ***

CC: (none) => b116d


Note You need to log in before you can comment on or make changes to this bug.