+++ This bug was initially created as a clone of Bug #653245 +++ Description of problem: The kernel syslog contains debugging information that is often useful during exploitation of other vulnerabilities, such as kernel heap addresses. Rather than futilely attempt to sanitize hundreds (or thousands) of printk statements and simultaneously cripple useful debugging functionality, it is far simpler to create an option that prevents unprivileged users from reading the syslog. This patch, loosely based on grsecurity's GRKERNSEC_DMESG, creates the dmesg_restrict sysctl. When set to "0", the default, no restrictions are enforced. When set to "1", only users with CAP_SYS_ADMIN can read the kernel syslog via dmesg(8) or other mechanisms. Upstream commit: http://git.kernel.org/linus/eaf06b241b091357e72b76863ba16e89610d31bd
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
in kernel-2.6.18-236.el5 You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5 Detailed testing feedback is always welcomed.
confirmed setting dmesg_restrict to 1 will block dmesg log viewing as a user while still allowing root to run dmesg. [m@localhost ~]$ dmesg klogctl: Operation not permitted [m@localhost ~]$ cat /proc/sys/kernel/dmesg_restrict 1 [m@localhost ~]$ [m@localhost ~]$ cat /proc/sys/kernel/dmesg_restrict 0 [m@localhost ~]$ dmesg | head -n 2 Linux version 2.6.18-236.el5 (mockbuild.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Mon Dec 6 18:41:54 EST 2010 Command line: ro root=/dev/VolGroup00/LogVol00 rhgb quiet
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-0017.html