[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1331157503-3413-14-git-send-email-john.stultz@linaro.org>
Date: Wed, 7 Mar 2012 13:58:23 -0800
From: John Stultz <john.stultz@...aro.org>
To: lkml <linux-kernel@...r.kernel.org>
Cc: Nick Kralevich <nnk@...gle.com>,
Greg KH <gregkh@...uxfoundation.org>,
Android Kernel Team <kernel-team@...roid.com>,
John Stultz <john.stultz@...aro.org>
Subject: [PATCH 13/13] android: ram_console: honor dmesg_restrict
From: Nick Kralevich <nnk@...gle.com>
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.
Bug: 5555691
CC: Greg KH <gregkh@...uxfoundation.org>
CC: Android Kernel Team <kernel-team@...roid.com>
Change-Id: I50ecb74012ef2ac0a3cff7325192634341fddae9
Signed-off-by: Nick Kralevich <nnk@...gle.com>
Signed-off-by: John Stultz <john.stultz@...aro.org>
---
drivers/staging/android/ram_console.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/android/ram_console.c b/drivers/staging/android/ram_console.c
index d956b84..b242be2 100644
--- a/drivers/staging/android/ram_console.c
+++ b/drivers/staging/android/ram_console.c
@@ -99,6 +99,9 @@ static ssize_t ram_console_read_old(struct file *file, char __user *buf,
char *str;
int ret;
+ if (dmesg_restrict && !capable(CAP_SYSLOG))
+ return -EPERM;
+
/* Main last_kmsg log */
if (pos < old_log_size) {
count = min(len, (size_t)(old_log_size - pos));
--
1.7.3.2.146.gca209
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists