2004-11-04 02:36:53

by Keith Owens

[permalink] [raw]
Subject: [patch 2.4.28-rc1] Avoid oops in proc_delete_inode

Under heavy load, vmstat, top and other programs that access /proc can
oops. PROC_INODE_PROPER(inode) is sometimes false for pid entries
(usually zombies), but inode->u.generic_ip is not NULL.

Backport a fix by AL Viro from 2.5.7-pre2 to 2.4.28-rc1.

Signed-off-by: Keith Owens <[email protected]>

Index: 2.4.28-rc1/fs/proc/base.c
===================================================================
--- 2.4.28-rc1.orig/fs/proc/base.c 2004-08-08 10:10:49.000000000 +1000
+++ 2.4.28-rc1/fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100
@@ -780,6 +780,7 @@ out:
return inode;

out_unlock:
+ node->u.generic_ip = NULL;
iput(inode);
return NULL;
}


2004-11-04 15:31:31

by Marc-Christian Petersen

[permalink] [raw]
Subject: Re: [patch 2.4.28-rc1] Avoid oops in proc_delete_inode

On Thursday 04 November 2004 03:35, Keith Owens wrote:

Marcelo,

I just saw you applied this to bk. Cool, but please apply a right version ;)

> Under heavy load, vmstat, top and other programs that access /proc can
> oops. PROC_INODE_PROPER(inode) is sometimes false for pid entries
> (usually zombies), but inode->u.generic_ip is not NULL.
>
> Backport a fix by AL Viro from 2.5.7-pre2 to 2.4.28-rc1.
>
> Signed-off-by: Keith Owens <[email protected]>
>
> Index: 2.4.28-rc1/fs/proc/base.c
> ===================================================================
> --- 2.4.28-rc1.orig/fs/proc/base.c 2004-08-08 10:10:49.000000000 +1000
> +++ 2.4.28-rc1/fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100
> @@ -780,6 +780,7 @@ out:
> return inode;
>
> out_unlock:
> + node->u.generic_ip = NULL;

has to be:

+ inode->u.generic_ip = NULL;

> iput(inode);
> return NULL;
> }

ciao, Marc

2004-11-04 20:36:14

by Keith Owens

[permalink] [raw]
Subject: Re: [patch 2.4.28-rc1] Avoid oops in proc_delete_inode

On Thu, 4 Nov 2004 16:29:17 +0100,
Marc-Christian Petersen <[email protected]> wrote:
>On Thursday 04 November 2004 03:35, Keith Owens wrote:
>
>Marcelo,
>
>I just saw you applied this to bk. Cool, but please apply a right version ;)
>
>> Under heavy load, vmstat, top and other programs that access /proc can
>> oops. PROC_INODE_PROPER(inode) is sometimes false for pid entries
>> (usually zombies), but inode->u.generic_ip is not NULL.
>>
>> Backport a fix by AL Viro from 2.5.7-pre2 to 2.4.28-rc1.
>>
>> Signed-off-by: Keith Owens <[email protected]>
>>
>> Index: 2.4.28-rc1/fs/proc/base.c
>> ===================================================================
>> --- 2.4.28-rc1.orig/fs/proc/base.c 2004-08-08 10:10:49.000000000 +1000
>> +++ 2.4.28-rc1/fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100
>> @@ -780,6 +780,7 @@ out:
>> return inode;
>>
>> out_unlock:
>> + node->u.generic_ip = NULL;
>
>has to be:
>
> + inode->u.generic_ip = NULL;
>
>> iput(inode);
>> return NULL;
>> }

Oops, copied the old patch into the mail. Where did I put that brown
paper bag?

2004-11-04 20:44:47

by Marcelo Tosatti

[permalink] [raw]
Subject: Re: [patch 2.4.28-rc1] Avoid oops in proc_delete_inode

On Thu, Nov 04, 2004 at 04:29:17PM +0100, Marc-Christian Petersen wrote:
> On Thursday 04 November 2004 03:35, Keith Owens wrote:
>
> Marcelo,
>
> I just saw you applied this to bk. Cool, but please apply a right version ;)
>
> > Under heavy load, vmstat, top and other programs that access /proc can
> > oops. PROC_INODE_PROPER(inode) is sometimes false for pid entries
> > (usually zombies), but inode->u.generic_ip is not NULL.
> >
> > Backport a fix by AL Viro from 2.5.7-pre2 to 2.4.28-rc1.
> >
> > Signed-off-by: Keith Owens <[email protected]>
> >
> > Index: 2.4.28-rc1/fs/proc/base.c
> > ===================================================================
> > --- 2.4.28-rc1.orig/fs/proc/base.c 2004-08-08 10:10:49.000000000 +1000
> > +++ 2.4.28-rc1/fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100
> > @@ -780,6 +780,7 @@ out:
> > return inode;
> >
> > out_unlock:
> > + node->u.generic_ip = NULL;
>
> has to be:
>
> + inode->u.generic_ip = NULL;

Done, thanks.