Bug 653252

Summary: kernel: restrict unprivileged access to kernel syslog [rhel-4.9]
Product: Red Hat Enterprise Linux 4 Reporter: Eugene Teo (Security Response) <eteo>
Component: kernelAssignee: Frantisek Hrbata <fhrbata>
Status: CLOSED ERRATA QA Contact: Evan McNabb <emcnabb>
Severity: high Docs Contact:
Priority: high    
Version: 4.9CC: dhoward, jolsa, lwang, penguin-kernel, plyons, syeghiay, vgoyal
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 653245 Environment:
Last Closed: 2011-02-16 15:49:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 653245, 653254    
Bug Blocks: 653250    

Description Eugene Teo (Security Response) 2010-11-15 04:24:49 UTC
+++ 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

Comment 3 RHEL Program Management 2010-12-17 18:49:46 UTC
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.

Comment 4 Vivek Goyal 2010-12-21 15:15:23 UTC
Committed in 94.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/

Comment 7 errata-xmlrpc 2011-02-16 15:49:56 UTC
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-0263.html

Comment 8 Tetsuo Handa 2011-04-01 06:12:49 UTC
By the way, kernel-2.6.9-100.EL.src.rpm contains a wrong entry
"CONFIG_SECURITY_DMESG_RESTRICT=n" in /usr/src/redhat/SOURCES/*.config .
Correct entry is "# CONFIG_SECURITY_DMESG_RESTRICT is not set".

kernel-2.6.9-i686-hugemem.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-i686-smp.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-i686-xenU.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-i686.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-ia64-largesmp.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-ia64.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-ppc.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-ppc.config:CONFIG_THERM_WINDTUNNEL=n
kernel-2.6.9-ppc.config:CONFIG_THERM_ADT746X=n
kernel-2.6.9-ppc64-largesmp.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-ppc64.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-ppc64iseries.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-s390.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-s390x.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-x86_64-largesmp.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-x86_64-smp.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-x86_64-xenU.config:CONFIG_SECURITY_DMESG_RESTRICT=n
kernel-2.6.9-x86_64.config:CONFIG_SECURITY_DMESG_RESTRICT=n