aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharndeep Grewal <csgrewa@tycho.ncsc.mil>2012-10-23 16:18:50 -0400
committerArve Hjønnevåg <arve@android.com>2013-04-29 14:43:14 -0700
commit1edc3b1e4bd03c40fc21385942c4fe2ac9bb6290 (patch)
treea0bf5fdc6c874d284adb7f3eb98bbf7a2b5f617f
parent7724238e14b5a9a813786746eae4ae2a18a21e37 (diff)
android: logger: enforce GID and CAP check on log flush
Restrict log flushing to those in the logs group, or anyone with CAP_SYSLOG. Change-Id: I5d6977d1c0d60ffe8487771cc195789e5db95454 Signed-off-by: Charndeep Grewal <csgrewa@tycho.ncsc.mil>
-rw-r--r--drivers/staging/android/logger.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
index cfa606110cc..b14a5574255 100644
--- a/drivers/staging/android/logger.c
+++ b/drivers/staging/android/logger.c
@@ -695,6 +695,11 @@ static long logger_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
ret = -EBADF;
break;
}
+ if (!(in_egroup_p(file->f_dentry->d_inode->i_gid) ||
+ capable(CAP_SYSLOG))) {
+ ret = -EPERM;
+ break;
+ }
list_for_each_entry(reader, &log->readers, list)
reader->r_off = log->w_off;
log->head = log->w_off;