Skip to content

Commit 87df842

Browse files
arndbfweisbec
authored andcommitted
procfs: Kill BKL in llseek on proc base
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 <[email protected]> [restore proc_fdinfo_file_operations as non-seekable] Signed-off-by: Frederic Weisbecker <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: John Kacur <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Al Viro <[email protected]>
1 parent 2eaa9cf commit 87df842

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

fs/proc/base.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ static ssize_t proc_info_read(struct file * file, char __user * buf,
728728

729729
static const struct file_operations proc_info_file_operations = {
730730
.read = proc_info_read,
731+
.llseek = generic_file_llseek,
731732
};
732733

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

986987
static const struct file_operations proc_environ_operations = {
987988
.read = environ_read,
989+
.llseek = generic_file_llseek,
988990
};
989991

990992
static ssize_t oom_adjust_read(struct file *file, char __user *buf,
@@ -1058,6 +1060,7 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf,
10581060
static const struct file_operations proc_oom_adjust_operations = {
10591061
.read = oom_adjust_read,
10601062
.write = oom_adjust_write,
1063+
.llseek = generic_file_llseek,
10611064
};
10621065

10631066
#ifdef CONFIG_AUDITSYSCALL
@@ -1129,6 +1132,7 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf,
11291132
static const struct file_operations proc_loginuid_operations = {
11301133
.read = proc_loginuid_read,
11311134
.write = proc_loginuid_write,
1135+
.llseek = generic_file_llseek,
11321136
};
11331137

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

11501154
static const struct file_operations proc_sessionid_operations = {
11511155
.read = proc_sessionid_read,
1156+
.llseek = generic_file_llseek,
11521157
};
11531158
#endif
11541159

@@ -1200,6 +1205,7 @@ static ssize_t proc_fault_inject_write(struct file * file,
12001205
static const struct file_operations proc_fault_inject_operations = {
12011206
.read = proc_fault_inject_read,
12021207
.write = proc_fault_inject_write,
1208+
.llseek = generic_file_llseek,
12031209
};
12041210
#endif
12051211

@@ -1941,7 +1947,7 @@ static ssize_t proc_fdinfo_read(struct file *file, char __user *buf,
19411947
}
19421948

19431949
static const struct file_operations proc_fdinfo_file_operations = {
1944-
.open = nonseekable_open,
1950+
.open = nonseekable_open,
19451951
.read = proc_fdinfo_read,
19461952
};
19471953

@@ -2225,6 +2231,7 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
22252231
static const struct file_operations proc_pid_attr_operations = {
22262232
.read = proc_pid_attr_read,
22272233
.write = proc_pid_attr_write,
2234+
.llseek = generic_file_llseek,
22282235
};
22292236

22302237
static const struct pid_entry attr_dir_stuff[] = {
@@ -2345,6 +2352,7 @@ static ssize_t proc_coredump_filter_write(struct file *file,
23452352
static const struct file_operations proc_coredump_filter_operations = {
23462353
.read = proc_coredump_filter_read,
23472354
.write = proc_coredump_filter_write,
2355+
.llseek = generic_file_llseek,
23482356
};
23492357
#endif
23502358

0 commit comments

Comments
 (0)