lkml.org 
[lkml]   [2002]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] remove LSM file_llseek hook
In the initial discussion LSM folks agreed on this, the
rationale is that lsseek itself makes no sense to
project as mmap() and pread/pwrite() allow access to any
area of the file anyway.

--- 1.19/fs/read_write.c Thu Oct 10 23:36:26 2002
+++ edited/fs/read_write.c Thu Oct 17 16:40:28 2002
@@ -121,12 +121,6 @@
if (!file)
goto bad;

- retval = security_ops->file_llseek(file);
- if (retval) {
- fput(file);
- goto bad;
- }
-
retval = -EINVAL;
if (origin <= 2) {
loff_t res = llseek(file, offset, origin);
@@ -152,10 +146,6 @@
file = fget(fd);
if (!file)
goto bad;
-
- retval = security_ops->file_llseek(file);
- if (retval)
- goto out_putf;

retval = -EINVAL;
if (origin > 2)
--- 1.4/include/linux/security.h Tue Oct 8 11:20:18 2002
+++ edited/include/linux/security.h Thu Oct 17 16:40:44 2002
@@ -376,10 +376,6 @@
* @file_free_security:
* Deallocate and free any security structures stored in file->f_security.
* @file contains the file structure being modified.
- * @file_llseek:
- * Check permission before re-positioning the file offset in @file.
- * @file contains the file structure being modified.
- * Return 0 if permission is granted.
* @file_ioctl:
* @file contains the file structure.
* @cmd contains the operation to perform.
@@ -790,7 +786,6 @@
int (*file_permission) (struct file * file, int mask);
int (*file_alloc_security) (struct file * file);
void (*file_free_security) (struct file * file);
- int (*file_llseek) (struct file * file);
int (*file_ioctl) (struct file * file, unsigned int cmd,
unsigned long arg);
int (*file_mmap) (struct file * file,
--- 1.6/security/capability.c Tue Oct 8 11:01:30 2002
+++ edited/security/capability.c Thu Oct 17 16:41:03 2002
@@ -442,11 +442,6 @@
return;
}

-static int cap_file_llseek (struct file *file)
-{
- return 0;
-}
-
static int cap_file_ioctl (struct file *file, unsigned int command,
unsigned long arg)
{
@@ -787,7 +782,6 @@
.file_permission = cap_file_permission,
.file_alloc_security = cap_file_alloc_security,
.file_free_security = cap_file_free_security,
- .file_llseek = cap_file_llseek,
.file_ioctl = cap_file_ioctl,
.file_mmap = cap_file_mmap,
.file_mprotect = cap_file_mprotect,
--- 1.7/security/dummy.c Tue Oct 8 11:01:30 2002
+++ edited/security/dummy.c Thu Oct 17 16:41:06 2002
@@ -344,11 +344,6 @@
return;
}

-static int dummy_file_llseek (struct file *file)
-{
- return 0;
-}
-
static int dummy_file_ioctl (struct file *file, unsigned int command,
unsigned long arg)
{
@@ -602,7 +597,6 @@
.file_permission = dummy_file_permission,
.file_alloc_security = dummy_file_alloc_security,
.file_free_security = dummy_file_free_security,
- .file_llseek = dummy_file_llseek,
.file_ioctl = dummy_file_ioctl,
.file_mmap = dummy_file_mmap,
.file_mprotect = dummy_file_mprotect,
-
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/
\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.031 / U:16.604 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site