Skip to content

Commit

Permalink
procfs: Kill BKL in llseek on proc base
Browse files Browse the repository at this point in the history
We don't use the BKL elsewhere, so use generic_file_llseek
so we can avoid default_llseek taking the BKL.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[restore proc_fdinfo_file_operations as non-seekable]
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: John Kacur <jkacur@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
  • Loading branch information
Arnd Bergmann authored and Frederic Weisbecker committed Apr 9, 2010
1 parent 2eaa9cf commit 87df842
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ static ssize_t proc_info_read(struct file * file, char __user * buf,

static const struct file_operations proc_info_file_operations = {
.read = proc_info_read,
.llseek = generic_file_llseek,
};

static int proc_single_show(struct seq_file *m, void *v)
Expand Down Expand Up @@ -985,6 +986,7 @@ static ssize_t environ_read(struct file *file, char __user *buf,

static const struct file_operations proc_environ_operations = {
.read = environ_read,
.llseek = generic_file_llseek,
};

static ssize_t oom_adjust_read(struct file *file, char __user *buf,
Expand Down Expand Up @@ -1058,6 +1060,7 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf,
static const struct file_operations proc_oom_adjust_operations = {
.read = oom_adjust_read,
.write = oom_adjust_write,
.llseek = generic_file_llseek,
};

#ifdef CONFIG_AUDITSYSCALL
Expand Down Expand Up @@ -1129,6 +1132,7 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf,
static const struct file_operations proc_loginuid_operations = {
.read = proc_loginuid_read,
.write = proc_loginuid_write,
.llseek = generic_file_llseek,
};

static ssize_t proc_sessionid_read(struct file * file, char __user * buf,
Expand All @@ -1149,6 +1153,7 @@ static ssize_t proc_sessionid_read(struct file * file, char __user * buf,

static const struct file_operations proc_sessionid_operations = {
.read = proc_sessionid_read,
.llseek = generic_file_llseek,
};
#endif

Expand Down Expand Up @@ -1200,6 +1205,7 @@ static ssize_t proc_fault_inject_write(struct file * file,
static const struct file_operations proc_fault_inject_operations = {
.read = proc_fault_inject_read,
.write = proc_fault_inject_write,
.llseek = generic_file_llseek,
};
#endif

Expand Down Expand Up @@ -1941,7 +1947,7 @@ static ssize_t proc_fdinfo_read(struct file *file, char __user *buf,
}

static const struct file_operations proc_fdinfo_file_operations = {
.open = nonseekable_open,
.open = nonseekable_open,
.read = proc_fdinfo_read,
};

Expand Down Expand Up @@ -2225,6 +2231,7 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
static const struct file_operations proc_pid_attr_operations = {
.read = proc_pid_attr_read,
.write = proc_pid_attr_write,
.llseek = generic_file_llseek,
};

static const struct pid_entry attr_dir_stuff[] = {
Expand Down Expand Up @@ -2345,6 +2352,7 @@ static ssize_t proc_coredump_filter_write(struct file *file,
static const struct file_operations proc_coredump_filter_operations = {
.read = proc_coredump_filter_read,
.write = proc_coredump_filter_write,
.llseek = generic_file_llseek,
};
#endif

Expand Down

0 comments on commit 87df842

Please sign in to comment.