public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RFC] 2.5.42: remove capable(CAP_SYS_RAWIO) check from open_kmem
@ 2002-10-13 12:46 Olaf Dietsche
  2002-10-17 11:00 ` Olaf Dietsche
  0 siblings, 1 reply; 11+ messages in thread
From: Olaf Dietsche @ 2002-10-13 12:46 UTC (permalink / raw)
  To: linux-kernel

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.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <3DA985E6.6090302@colorfullife.com>]

end of thread, other threads:[~2002-10-17 16:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
     [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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox