lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1361945258-24420-6-git-send-email-john.stultz@linaro.org>
Date:	Tue, 26 Feb 2013 22:07:38 -0800
From:	John Stultz <john.stultz@...aro.org>
To:	lkml <linux-kernel@...r.kernel.org>
Cc:	Charndeep Grewal <csgrewa@...ho.ncsc.mil>,
	Android Kernel Team <kernel-team@...roid.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	John Stultz <john.stultz@...aro.org>
Subject: [PATCH 5/5] staging: android: logger: enforce GID and CAP check on log flush

From: Charndeep Grewal <csgrewa@...ho.ncsc.mil>

Restrict log flushing to those in the logs group, or
anyone with CAP_SYSLOG.

Cc: Android Kernel Team <kernel-team@...roid.com>
Cc: Charndeep Grewal <csgrewa@...ho.ncsc.mil>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Charndeep Grewal <csgrewa@...ho.ncsc.mil>
Signed-off-by: John Stultz <john.stultz@...aro.org>
---
 drivers/staging/android/logger.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
index cfa6061..b14a557 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;
-- 
1.7.10.4

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ