Skip to content

Commit 73296bc

Browse files
committed
procfs: Use generic_file_llseek in /proc/vmcore
/proc/vmcore has no llseek and then falls down to use default_llseek. This is racy against read_vmcore() that directly manipulates fpos but it doesn't hold the bkl there so using it in llseek doesn't protect anything. Let's use generic_file_llseek() instead. Signed-off-by: Frederic Weisbecker <[email protected]> Acked-by: Arnd Bergmann <[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 41775e2 commit 73296bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/proc/vmcore.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
162162

163163
static const struct file_operations proc_vmcore_operations = {
164164
.read = read_vmcore,
165+
.llseek = generic_file_llseek,
165166
};
166167

167168
static struct vmcore* __init get_new_element(void)

0 commit comments

Comments
 (0)