linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] procfs bug exposed by cdev changes
@ 2003-05-28  0:31 viro
  2003-05-28  4:35 ` Florin Iucha
  0 siblings, 1 reply; 4+ messages in thread
From: viro @ 2003-05-28  0:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

	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.

--- C70/fs/proc/inode.c	Mon May 26 22:21:40 2003
+++ C70-current/fs/proc/inode.c	Tue May 27 20:07:01 2003
@@ -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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] procfs bug exposed by cdev changes
  2003-05-28  0:31 [PATCH] procfs bug exposed by cdev changes viro
@ 2003-05-28  4:35 ` Florin Iucha
  0 siblings, 0 replies; 4+ messages in thread
From: Florin Iucha @ 2003-05-28  4:35 UTC (permalink / raw)
  To: viro; +Cc: Linus Torvalds, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

On Wed, May 28, 2003 at 01:31:05AM +0100, viro@parcelfarce.linux.theplanet.co.uk wrote:
> 	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

-- 

"NT is to UNIX what a doughnut is to a particle accelerator."

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] procfs bug exposed by cdev changes
  2003-05-28 18:06 Olivier NICOLAS
@ 2003-05-28 18:18 ` Stian Jordet
  0 siblings, 0 replies; 4+ messages in thread
From: Stian Jordet @ 2003-05-28 18:18 UTC (permalink / raw)
  To: linux-kernel

ons, 28.05.2003 kl. 20.06 skrev Olivier NICOLAS:
> >        Please, apply. Folks who'd seen oopsen/memory corruption after
> >ALSA access - please, check if that fixes all problems.
> ALSA works for me,
And me :)

Best regards,
Stian


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] procfs bug exposed by cdev changes
@ 2003-05-28 18:06 Olivier NICOLAS
  2003-05-28 18:18 ` Stian Jordet
  0 siblings, 1 reply; 4+ messages in thread
From: Olivier NICOLAS @ 2003-05-28 18:06 UTC (permalink / raw)
  To: linux-kernel

 >       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.


modprobe snd-intel8x0
rmmod snd-intel8x0

ALSA works for me,

Thanks
Olivier




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-05-28 18:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-28  0:31 [PATCH] procfs bug exposed by cdev changes viro
2003-05-28  4:35 ` Florin Iucha
2003-05-28 18:06 Olivier NICOLAS
2003-05-28 18:18 ` Stian Jordet

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).