public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Olaf Dabrunz <od@suse.de>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Andries.Brouwer@cwi.nl
Subject: Re: [PATCH] report size of printk buffer
Date: Wed, 5 May 2004 15:12:52 +0200	[thread overview]
Message-ID: <20040505131252.GA23800@suse.de> (raw)
In-Reply-To: <UTC200405041609.i44G9CH29412.aeb@smtp.cwi.nl>

On 04-May-04, Andries.Brouwer@cwi.nl wrote:
> In the old days the printk log buffer had a constant size,
> and dmesg asked for the 4096, later 8192, later 16384 bytes in there.
> These days the printk log buffer has variable size, and it is not
> easy for dmesg to do the right thing, especially when doing a
> "read and clear".
> The patch below adds a syslog subfuntion that reports the buffer size.
> 
> [...]

Please also consider allowing everyone to read the ring buffer size.
This way dmesg will continue to behave the same for users and root when
they read the log buffer. (And other options will continue to be denied
to the user.)

Please note that users are already allowed to read the ring buffer (case
3).

Short security analysis:
There is no dynamic information provided. So system behaviour cannot be
infered from reading the ring buffer size.

The information provided can already be infered from the architecture and
release of the distribution. And there are other methods as well.

--- ./security/selinux/hooks.c	2004-05-04 16:36:25.000000000 +0200
+++ ./security/selinux/hooks.c	2004-05-04 16:36:27.000000000 +0200
@@ -1467,6 +1467,7 @@
 
 	switch (type) {
 		case 3:         /* Read last kernel messages */
+		case 10:        /* Return size of the log buffer */
 			rc = task_has_system(current, SYSTEM__SYSLOG_READ);
 			break;
 		case 6:         /* Disable logging to console */
--- ./security/commoncap.c	2004-05-04 17:26:08.758271491 +0200
+++ ./security/commoncap.c	2004-05-04 17:25:05.256269096 +0200
@@ -293,7 +293,7 @@
 
 int cap_syslog (int type)
 {
-	if ((type != 3) && !capable(CAP_SYS_ADMIN))
+	if ((type != 3 && type != 10) && !capable(CAP_SYS_ADMIN))
 		return -EPERM;
 	return 0;
 }
--- ./security/dummy.c	2004-05-04 16:36:38.000000000 +0200
+++ ./security/dummy.c	2004-05-04 16:34:22.000000000 +0200
@@ -97,7 +97,7 @@
 
 static int dummy_syslog (int type)
 {
-	if ((type != 3) && current->euid)
+	if ((type != 3 && type != 10) && current->euid)
 		return -EPERM;
 	return 0;
 }

-- 
Olaf Dabrunz (od/odabrunz), SUSE Linux AG, Nürnberg


  reply	other threads:[~2004-05-05 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-04 16:09 [PATCH] report size of printk buffer Andries.Brouwer
2004-05-05 13:12 ` Olaf Dabrunz [this message]
2004-05-05 20:42 ` Roman Zippel
2004-05-06 13:36   ` Andries Brouwer
2004-05-06 15:11     ` Roman Zippel
2004-05-06 15:23       ` Andries Brouwer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040505131252.GA23800@suse.de \
    --to=od@suse.de \
    --cc=Andries.Brouwer@cwi.nl \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox