LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH -mm] Fix lseek on /proc/kcore
@ 2007-03-22 9:56 Alexey Dobriyan
2007-03-22 13:14 ` Arjan van de Ven
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2007-03-22 9:56 UTC (permalink / raw)
To: akpm; +Cc: Eric Dumazet, linux-kernel
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
---
fs/proc/inode.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -167,8 +167,9 @@ static loff_t proc_reg_llseek(struct fil
llseek = pde->proc_fops->llseek;
spin_unlock(&pde->pde_unload_lock);
- if (llseek)
- rv = llseek(file, offset, whence);
+ if (!llseek)
+ llseek = default_llseek;
+ rv = llseek(file, offset, whence);
spin_lock(&pde->pde_unload_lock);
pde->pde_users--;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -mm] Fix lseek on /proc/kcore
2007-03-22 9:56 [PATCH -mm] Fix lseek on /proc/kcore Alexey Dobriyan
@ 2007-03-22 13:14 ` Arjan van de Ven
2007-03-28 8:05 ` Alexey Dobriyan
0 siblings, 1 reply; 3+ messages in thread
From: Arjan van de Ven @ 2007-03-22 13:14 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: akpm, Eric Dumazet, linux-kernel
On Thu, 2007-03-22 at 12:56 +0300, Alexey Dobriyan wrote:
> Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
> ---
>
> fs/proc/inode.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> --- a/fs/proc/inode.c
> +++ b/fs/proc/inode.c
> @@ -167,8 +167,9 @@ static loff_t proc_reg_llseek(struct fil
> llseek = pde->proc_fops->llseek;
> spin_unlock(&pde->pde_unload_lock);
>
> - if (llseek)
> - rv = llseek(file, offset, whence);
> + if (!llseek)
> + llseek = default_llseek;
> + rv = llseek(file, offset, whence);
>
this has potential impact way outside kcore......
did you audit all proc users to see if they can deal with lseek?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -mm] Fix lseek on /proc/kcore
2007-03-22 13:14 ` Arjan van de Ven
@ 2007-03-28 8:05 ` Alexey Dobriyan
0 siblings, 0 replies; 3+ messages in thread
From: Alexey Dobriyan @ 2007-03-28 8:05 UTC (permalink / raw)
To: Arjan van de Ven; +Cc: akpm, Eric Dumazet, linux-kernel
On Thu, Mar 22, 2007 at 02:14:35PM +0100, Arjan van de Ven wrote:
> On Thu, 2007-03-22 at 12:56 +0300, Alexey Dobriyan wrote:
> > --- a/fs/proc/inode.c
> > +++ b/fs/proc/inode.c
> > @@ -167,8 +167,9 @@ static loff_t proc_reg_llseek(struct fil
> > llseek = pde->proc_fops->llseek;
> > spin_unlock(&pde->pde_unload_lock);
> >
> > - if (llseek)
> > - rv = llseek(file, offset, whence);
> > + if (!llseek)
> > + llseek = default_llseek;
> > + rv = llseek(file, offset, whence);
> >
>
> this has potential impact way outside kcore......
>
> did you audit all proc users to see if they can deal with lseek?
Mainline deals with lseek on proc entries as follows:
* use default_llseek()
* but if proc entry set ->llseek via ->proc_fops, use custom llseek
With introduction of proxying, ->llseek was suddenly set on all proc
entries, so default_llseek() was never used, but -E started to be
returned for all of them that were relying on default_llseek().
So this patch brings proc_reg_llseek() in sync with vfs_llseek().
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-03-28 8:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-22 9:56 [PATCH -mm] Fix lseek on /proc/kcore Alexey Dobriyan
2007-03-22 13:14 ` Arjan van de Ven
2007-03-28 8:05 ` Alexey Dobriyan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).