Skip to contentSkip to conversation

procfs bug exposed by cdev changes

PATCH In review [email protected] 2 participants 2 messages May 28, 2003 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 procfs bug exposed by cdev changes

	fs/inode.c assumes that any ->delete_inode() will call clear_inode().

procfs instance doesn't. It had passed unpunished for a while; cdev changes combined with ALSA creating character devices in procfs made it fatal.

Patch follows. It had fixed ALSA-triggered memory corruption here -
what happens in vanilla 2.5.70 is that clear_inode() is not called when procfs character device inodes are freed. That leaves a freed inode on a cyclic list, with obvious unpleasantness following when we try to traverse it (e.g. when unregistering a device).

Please, apply. Folks who'd seen oopsen/memory corruption after
ALSA access - please, check if that fixes all problems.

fs/proc/inode.c +1 -2
@@ -61,8 +61,6 @@
 	struct proc_dir_entry *de;
 	struct task_struct *tsk;
 
-	inode->i_state = I_CLEAR;
-
 	/* Let go of any associated process */
 	tsk = PROC_I(inode)->task;
 	if (tsk)
@@ -75,6 +73,7 @@
 			module_put(de->owner);
 		de_put(de);
 	}
+	clear_inode(inode);
 }
 
 struct vfsmount *proc_mnt;
#1 lore raw
Quoted 8 lines · On Wed, May 28, 2003 at 01:31:05AM +0100…

Patch follows. It had fixed ALSA-triggered memory corruption here -
what happens in vanilla 2.5.70 is that clear_inode() is not called when procfs character device inodes are freed. That leaves a freed inode on a cyclic list, with obvious unpleasantness following when we try to traverse it (e.g. when unregistering a device).

Please, apply. Folks who'd seen oopsen/memory corruption after
ALSA access - please, check if that fixes all problems.

It works fine. The ALSA loads, plays and unloads without a problem.

Thank you,
florin

Signature · 1 line
"NT is to UNIX what a doughnut is to a particle accelerator."