Commit b5a6c077 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

[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.
parent 22652747
...@@ -121,12 +121,6 @@ asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin) ...@@ -121,12 +121,6 @@ asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin)
if (!file) if (!file)
goto bad; goto bad;
retval = security_ops->file_llseek(file);
if (retval) {
fput(file);
goto bad;
}
retval = -EINVAL; retval = -EINVAL;
if (origin <= 2) { if (origin <= 2) {
loff_t res = llseek(file, offset, origin); loff_t res = llseek(file, offset, origin);
...@@ -153,10 +147,6 @@ asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, ...@@ -153,10 +147,6 @@ asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
if (!file) if (!file)
goto bad; goto bad;
retval = security_ops->file_llseek(file);
if (retval)
goto out_putf;
retval = -EINVAL; retval = -EINVAL;
if (origin > 2) if (origin > 2)
goto out_putf; goto out_putf;
......
...@@ -376,10 +376,6 @@ struct swap_info_struct; ...@@ -376,10 +376,6 @@ struct swap_info_struct;
* @file_free_security: * @file_free_security:
* Deallocate and free any security structures stored in file->f_security. * Deallocate and free any security structures stored in file->f_security.
* @file contains the file structure being modified. * @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_ioctl:
* @file contains the file structure. * @file contains the file structure.
* @cmd contains the operation to perform. * @cmd contains the operation to perform.
...@@ -790,7 +786,6 @@ struct security_operations { ...@@ -790,7 +786,6 @@ struct security_operations {
int (*file_permission) (struct file * file, int mask); int (*file_permission) (struct file * file, int mask);
int (*file_alloc_security) (struct file * file); int (*file_alloc_security) (struct file * file);
void (*file_free_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, int (*file_ioctl) (struct file * file, unsigned int cmd,
unsigned long arg); unsigned long arg);
int (*file_mmap) (struct file * file, int (*file_mmap) (struct file * file,
......
...@@ -442,11 +442,6 @@ static void cap_file_free_security (struct file *file) ...@@ -442,11 +442,6 @@ static void cap_file_free_security (struct file *file)
return; return;
} }
static int cap_file_llseek (struct file *file)
{
return 0;
}
static int cap_file_ioctl (struct file *file, unsigned int command, static int cap_file_ioctl (struct file *file, unsigned int command,
unsigned long arg) unsigned long arg)
{ {
...@@ -787,7 +782,6 @@ static struct security_operations capability_ops = { ...@@ -787,7 +782,6 @@ static struct security_operations capability_ops = {
.file_permission = cap_file_permission, .file_permission = cap_file_permission,
.file_alloc_security = cap_file_alloc_security, .file_alloc_security = cap_file_alloc_security,
.file_free_security = cap_file_free_security, .file_free_security = cap_file_free_security,
.file_llseek = cap_file_llseek,
.file_ioctl = cap_file_ioctl, .file_ioctl = cap_file_ioctl,
.file_mmap = cap_file_mmap, .file_mmap = cap_file_mmap,
.file_mprotect = cap_file_mprotect, .file_mprotect = cap_file_mprotect,
......
...@@ -344,11 +344,6 @@ static void dummy_file_free_security (struct file *file) ...@@ -344,11 +344,6 @@ static void dummy_file_free_security (struct file *file)
return; return;
} }
static int dummy_file_llseek (struct file *file)
{
return 0;
}
static int dummy_file_ioctl (struct file *file, unsigned int command, static int dummy_file_ioctl (struct file *file, unsigned int command,
unsigned long arg) unsigned long arg)
{ {
...@@ -602,7 +597,6 @@ struct security_operations dummy_security_ops = { ...@@ -602,7 +597,6 @@ struct security_operations dummy_security_ops = {
.file_permission = dummy_file_permission, .file_permission = dummy_file_permission,
.file_alloc_security = dummy_file_alloc_security, .file_alloc_security = dummy_file_alloc_security,
.file_free_security = dummy_file_free_security, .file_free_security = dummy_file_free_security,
.file_llseek = dummy_file_llseek,
.file_ioctl = dummy_file_ioctl, .file_ioctl = dummy_file_ioctl,
.file_mmap = dummy_file_mmap, .file_mmap = dummy_file_mmap,
.file_mprotect = dummy_file_mprotect, .file_mprotect = dummy_file_mprotect,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment