public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: viro@parcelfarce.linux.theplanet.co.uk
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] procfs bug exposed by cdev changes
Date: Wed, 28 May 2003 01:31:05 +0100	[thread overview]
Message-ID: <20030528003105.GD27916@parcelfarce.linux.theplanet.co.uk> (raw)

	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;

             reply	other threads:[~2003-05-28  0:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-28  0:31 viro [this message]
2003-05-28  4:35 ` [PATCH] procfs bug exposed by cdev changes Florin Iucha
  -- strict thread matches above, loose matches on Subject: below --
2003-05-28 18:06 Olivier NICOLAS
2003-05-28 18:18 ` Stian Jordet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030528003105.GD27916@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox