From: Chris Evans <chris@scary.beasts.org>
To: Olaf Dietsche <olaf.dietsche#list.linux-kernel@t-online.de>
Cc: torvalds@transmeta.com, 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 12:32:31 +0100 [thread overview]
Message-ID: <E1828tD-0000V0-00@sphinx.mythic-beasts.com> (raw)
In-Reply-To: <87bs5tba9j.fsf@goat.bogus.local>
Hi,
No, please DON'T apply.
If /dev/mem and /dev/kmem are only protected by
filesystem permissions, then:
1) Ownership of either will confer CAP_SYS_RAWIO
2) CAP_DAC_OVERRIDE, etc. will confer CAP_SYS_RAWIO
3) Ability to mknod() one of the these will confer
CAP_SYS_RAWIO (I think to make one you only need
CAP_SYS_ADMIN, could be wrong).
CAP_SYS_RAWIO is extremely dangerous and must not
be leverageable via other system capabilities or
filesystem permissions.
There are many people who have systems with elaborate
security setups where root access is limited in what
it can do. If we allow a root user to get
CAP_SYS_RAWIO easily, this is lost.
Cheers
Chris
Quoting Olaf Dietsche
<olaf.dietsche#list.linux-kernel@t-online.de>:
> Olaf Dietsche
<olaf.dietsche#list.linux-kernel@t-online.de> writes:
>
> > In drivers/char/mem.c there's open_port(), which is
used as open_mem()
> > and open_kmem() as well. I don't see the benefit of
this, since
> > /dev/mem and /dev/kmem are already protected by
filesystem
> > permissions.
> >
> > mem.c, line 526:
> > static int open_port(struct inode * inode, struct
file * filp)
> > {
> > return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
> > }
> >
> > If anyone knows, why this is done this way, please
let me
> > know. Otherwise, I suggest the patch below.
>
> I haven't got a convincing answer against this patch,
so far. The
> patch applies to 2.5.43 as well.
> Linus, please apply.
>
> Regards, Olaf.
>
> --- a/drivers/char/mem.c Sat Oct 5 18:44:55 2002
> +++ b/drivers/char/mem.c Sun Oct 13 13:59:25 2002
> @@ -533,15 +533,12 @@
> #define full_lseek null_lseek
> #define write_zero write_null
> #define read_full read_zero
> -#define open_mem open_port
> -#define open_kmem open_mem
>
> static struct file_operations mem_fops = {
> llseek: memory_lseek,
> read: read_mem,
> write: write_mem,
> mmap: mmap_mem,
> - open: open_mem,
> };
>
> static struct file_operations kmem_fops = {
> @@ -549,7 +546,6 @@
> read: read_kmem,
> write: write_kmem,
> mmap: mmap_kmem,
> - open: open_kmem,
> };
>
> static struct file_operations null_fops = {
> -
> To unsubscribe from this list: send the line
"unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at
http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
next prev parent reply other threads:[~2002-10-17 11:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-13 12:46 Olaf Dietsche
2002-10-17 11:00 ` Olaf Dietsche
2002-10-17 11:32 ` Chris Evans [this message]
2002-10-17 12:30 ` Chris Wright
2002-10-17 14:14 ` Olaf Dietsche
[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=E1828tD-0000V0-00@sphinx.mythic-beasts.com \
--to=chris@scary.beasts.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf.dietsche#list.linux-kernel@t-online.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®