[PATCH 4/6] procfs: Use generic_file_llseek in /proc/vmcore

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Frederic Weisbecker
Date: Monday, March 29, 2010 - 11:20 pm

/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 <fweisbec@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
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>
---
 fs/proc/vmcore.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 0872afa..f942ecb 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -162,6 +162,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
 
 static const struct file_operations proc_vmcore_operations = {
 	.read		= read_vmcore,
+	.lseek		= generic_file_llseek,
 };
 
 static struct vmcore* __init get_new_element(void)
-- 
1.6.2.3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/6] Kill the bkl in procfs, Frederic Weisbecker, (Mon Mar 29, 11:20 pm)
[PATCH 1/6] procfs: Kill BKL in llseek on proc base, Frederic Weisbecker, (Mon Mar 29, 11:20 pm)
[PATCH 2/6] procfs: Use generic_file_llseek in /proc/kcore, Frederic Weisbecker, (Mon Mar 29, 11:20 pm)
[PATCH 3/6] procfs: Use generic_file_llseek in /proc/kmsg, Frederic Weisbecker, (Mon Mar 29, 11:20 pm)
[PATCH 4/6] procfs: Use generic_file_llseek in /proc/vmcore, Frederic Weisbecker, (Mon Mar 29, 11:20 pm)
[PATCH 5/6] procfs: Push down the bkl from ioctl, Frederic Weisbecker, (Mon Mar 29, 11:20 pm)
[PATCH 6/6] procfs: Kill the bkl in ioctl, Frederic Weisbecker, (Mon Mar 29, 11:20 pm)
Re: [PATCH 5/6] procfs: Push down the bkl from ioctl, Alexey Dobriyan, (Mon Mar 29, 11:31 pm)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Alexey Dobriyan, (Mon Mar 29, 11:38 pm)
Re: [PATCH 1/6] procfs: Kill BKL in llseek on proc base, Alexey Dobriyan, (Mon Mar 29, 11:40 pm)
Re: [PATCH 1/6] procfs: Kill BKL in llseek on proc base, Frederic Weisbecker, (Mon Mar 29, 11:50 pm)
Re: [PATCH 5/6] procfs: Push down the bkl from ioctl, Frederic Weisbecker, (Tue Mar 30, 12:02 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Frederic Weisbecker, (Tue Mar 30, 12:07 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Arnd Bergmann, (Tue Mar 30, 3:33 am)
Re: [PATCH 5/6] procfs: Push down the bkl from ioctl, Arnd Bergmann, (Tue Mar 30, 3:37 am)
Re: [PATCH 5/6] procfs: Push down the bkl from ioctl, Frederic Weisbecker, (Tue Mar 30, 11:27 am)
Re: [PATCH 5/6] procfs: Push down the bkl from ioctl, Arnd Bergmann, (Tue Mar 30, 11:54 am)
Re: [PATCH 5/6] procfs: Push down the bkl from ioctl, Frederic Weisbecker, (Tue Mar 30, 12:21 pm)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Frederic Weisbecker, (Wed Mar 31, 10:22 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Arnd Bergmann, (Wed Mar 31, 1:21 pm)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Arnd Bergmann, (Wed Mar 31, 2:04 pm)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Frederic Weisbecker, (Wed Mar 31, 2:41 pm)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Alan Cox, (Wed Mar 31, 2:55 pm)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Frederic Weisbecker, (Wed Mar 31, 2:56 pm)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Arnd Bergmann, (Thu Apr 1, 2:07 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Arnd Bergmann, (Thu Apr 1, 4:37 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Stefan Richter, (Thu Apr 1, 4:39 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Arnd Bergmann, (Thu Apr 1, 5:42 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Arnd Bergmann, (Thu Apr 1, 5:45 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Stefan Richter, (Sat Apr 3, 10:53 am)
[PATCH v2] procfs: Push down the bkl from ioctl, Frederic Weisbecker, (Fri Apr 9, 7:45 am)
[PATCH v3] procfs: Push down the bkl from ioctl, Frederic Weisbecker, (Sat Apr 10, 6:25 am)
Re: [PATCH 0/6] Kill the bkl in procfs, Frederic Weisbecker, (Sat Apr 10, 6:27 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Frederic Weisbecker, (Sat Apr 10, 8:28 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Frederic Weisbecker, (Sat Apr 10, 9:09 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Frederic Weisbecker, (Sat Apr 10, 9:14 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Frederic Weisbecker, (Sat Apr 10, 9:24 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Christoph Hellwig, (Sun Apr 11, 6:03 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Arnd Bergmann, (Mon Apr 12, 8:05 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Arnd Bergmann, (Mon Apr 12, 10:34 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Frederic Weisbecker, (Mon Apr 12, 2:53 pm)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Arnd Bergmann, (Tue Apr 13, 2:26 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Christoph Hellwig, (Tue Apr 13, 11:03 am)
Re: [PATCH 6/6] procfs: Kill the bkl in ioctl, Frederic Weisbecker, (Tue Apr 13, 1:10 pm)
[PATCH v4] procfs: Push down the bkl from ioctl, Frederic Weisbecker, (Sun May 16, 6:23 pm)