staging: android: ram_console: honor dmesg_restrict
authorNick Kralevich <nnk@google.com>
Thu, 8 Mar 2012 01:34:38 +0000 (17:34 -0800)
committerGrazvydas Ignotas <notasas@gmail.com>
Wed, 25 Apr 2012 22:25:07 +0000 (01:25 +0300)
commit8384c34df951edd5508eef381b75a9be573c2a19
tree938603bedc6ef4d17d3e232d17ac9b99da20dbf1
parentfd66c7d8e105602ace609b615f63919657679ccf
staging: android: ram_console: honor dmesg_restrict

The Linux kernel has a setting called dmesg_restrict. When true,
only processes with CAP_SYSLOG can view the kernel dmesg logs. This
helps prevent leaking of kernel information into user space.

On Android, it's possible to bypass these restrictions by viewing
/proc/last_kmsg.

This change makes /proc/last_kmsg require the same permissions as
dmesg.

CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Nick Kralevich <nnk@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ram_console.c