Avoid oops in proc_delete_inode
PATCH 1/1 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.
fs/proc/base.c +1 -0
@@ -780,6 +780,7 @@ out:return inode; out_unlock: + node->u.generic_ip =NULL ;iput (inode);return NULL ; }
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 ;)
Quoted 13 lines
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), butinode->u.generic_ipis 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
===================================================================
fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100 out: · line 783
Quoted 4 lines
fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100 renamed from fs/proc/base.c 2004-08-08 10:10:49.000000000 +1000 +1
-0@@ -780,6 +780,7 @@ out: return inode; out_unlock: + node->u.generic_ip = NULL;
has to be:
+ inode->u.generic_ip = NULL;
fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100 out: · line 786
Quoted 3 lines
fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100 renamed from fs/proc/base.c 2004-08-08 10:10:49.000000000 +1000 +0
-0iput(inode); return NULL; }
ciao, Marc
Quoted 21 lines · Marc-Christian Petersen
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 ;)
Quoted 15 lines
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), butinode->u.generic_ipis 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
===================================================================fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100 renamed from fs/proc/base.c 2004-08-08 10:10:49.000000000 +1000 +0
-0@@ -780,6 +780,7 @@ out: return inode;
Quoted 10 lines
fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100 out: · line 783
Quoted 2 lines
fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100 renamed from fs/proc/base.c 2004-08-08 10:10:49.000000000 +1000 +1
-0out_unlock: + node->u.generic_ip = NULL;has to be:
+
inode->u.generic_ip= NULL;Quoted 3 lines
fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100 renamed from fs/proc/base.c 2004-08-08 10:10:49.000000000 +1000 +0
-0iput(inode); return NULL; }
Oops, copied the old patch into the mail. Where did I put that brown paper bag?
Quoted 21 lines · Marc-Christian Petersen
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 ;)
Quoted 15 lines
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), butinode->u.generic_ipis 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
===================================================================fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100 renamed from fs/proc/base.c 2004-08-08 10:10:49.000000000 +1000 +0
-0@@ -780,6 +780,7 @@ out: return inode;
Quoted 6 lines
fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100 out: · line 783
Quoted 2 lines
fs/proc/base.c 2004-11-04 13:25:16.402602459 +1100 renamed from fs/proc/base.c 2004-08-08 10:10:49.000000000 +1000 +1
-0out_unlock: + node->u.generic_ip = NULL;has to be:
+
inode->u.generic_ip= NULL;
Done, thanks.