All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Dietsche <olaf.dietsche#list.linux-kernel@t-online.de>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH][RFC] 2.5.42: remove capable(CAP_SYS_RAWIO) check from open_kmem
Date: Thu, 17 Oct 2002 16:14:05 +0200	[thread overview]
Message-ID: <87bs5t9mqa.fsf@goat.bogus.local> (raw)
In-Reply-To: 20021017053014.C26442@figure1.int.wirex.com

Chris Wright <chris@wirex.com> writes:

> * Olaf Dietsche (olaf.dietsche#list.linux-kernel@t-online.de) wrote:
>> 
>> I haven't got a convincing answer against this patch, so far. The
>> patch applies to 2.5.43 as well.
>> Linus, please apply.

Hehe, "please apply" is watched a lot more closely, it seems. Good to
know ;-)

> No way.  This is clearly a bad idea.  CAP_SYS_RAWIO should be treated very
> seriously, look at what it enables.  CAP_DAC_OVERRIDE is substantially
> less powerful, and if you remove this check, it would be the only
> capability protecting this.

$ grep -r CAP_SYS_RAWIO v2.5.43 | wc
55

Well, since CAP_SYS_RAWIO is such a dangerous beast and /dev/kmem can't
live without, then something like CAP_SYS_KMEM would be more
appropriate.

Here's a new untested patch against 2.5.43. Comments?

Regards, Olaf.

diff -urN a/drivers/char/mem.c b/drivers/char/mem.c
--- a/drivers/char/mem.c	Sat Oct  5 18:44:55 2002
+++ b/drivers/char/mem.c	Thu Oct 17 16:02:56 2002
@@ -525,7 +525,7 @@
 
 static int open_port(struct inode * inode, struct file * filp)
 {
-	return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
+	return capable(CAP_SYS_KMEM) ? 0 : -EPERM;
 }
 
 #define mmap_kmem	mmap_mem
diff -urN a/include/linux/capability.h b/include/linux/capability.h
--- a/include/linux/capability.h	Sat Oct  5 18:43:38 2002
+++ b/include/linux/capability.h	Thu Oct 17 16:02:35 2002
@@ -283,6 +283,10 @@
 
 #define CAP_LEASE            28
 
+/* Allow access to system memory */
+
+#define CAP_SYS_KMEM         29
+
 #ifdef __KERNEL__
 /* 
  * Bounding set

  reply	other threads:[~2002-10-17 14:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-13 12:46 [PATCH][RFC] 2.5.42: remove capable(CAP_SYS_RAWIO) check from open_kmem Olaf Dietsche
2002-10-17 11:00 ` Olaf Dietsche
2002-10-17 11:32   ` Chris Evans
2002-10-17 12:30   ` Chris Wright
2002-10-17 14:14     ` Olaf Dietsche [this message]
     [not found]       ` <200210171807.33178.oliver@neukum.name>
2002-10-17 17:00         ` Olaf Dietsche
     [not found] <3DA985E6.6090302@colorfullife.com>
2002-10-13 15:48 ` Olaf Dietsche
     [not found]   ` <3DA99A8B.5050102@colorfullife.com>
2002-10-13 16:45     ` Olaf Dietsche
2002-10-13 17:04       ` Manfred Spraul
2002-10-13 22:05         ` Olaf Dietsche
2002-10-17 11:42           ` Andreas Steinmetz

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=87bs5t9mqa.fsf@goat.bogus.local \
    --to=olaf.dietsche#list.linux-kernel@t-online.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.