2003-05-28 00:17:51

by Al Viro

[permalink] [raw]
Subject: [PATCH] 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.

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


2003-05-28 04:21:55

by Florin Iucha

[permalink] [raw]
Subject: Re: [PATCH] procfs bug exposed by cdev changes

On Wed, May 28, 2003 at 01:31:05AM +0100, [email protected] 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."


Attachments:
(No filename) (712.00 B)
(No filename) (189.00 B)
Download all attachments

2003-05-28 17:54:58

by Olivier Nicolas

[permalink] [raw]
Subject: Re: [PATCH] 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.


modprobe snd-intel8x0
rmmod snd-intel8x0

ALSA works for me,

Thanks
Olivier



2003-05-28 18:04:10

by Stian Jordet

[permalink] [raw]
Subject: Re: [PATCH] procfs bug exposed by cdev changes

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