From: James W McMechan <mcmechanjw@juno.com>
To: blaisorblade_spam@yahoo.it
Cc: user-mode-linux-user@lists.sourceforge.net,
user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] [PATCH] fix for: Host panic when UML reads host /dev/shm
Date: Wed, 10 Dec 2003 07:36:39 -0800 [thread overview]
Message-ID: <20031210.073651.-388765.0.mcmechanjw@juno.com> (raw)
Ok here are the two patches one each for 2.4.23
and 2.6.0-test11
Linus has accepted the test11 patch into bk so
the next 2.6 kernel should have the fix
I have also been testing a 2.4.23 patch
They no longer oopes with any of my test programs
Since you were having problems here they are
Enjoy, James McMechan
The problem was that the list_del was deleting
the cursor while the p pointer was at the cursor
the list_add_tail then oopes on the poisoned
pointers, since the cursor was to be deleted
anyway and should not be counted as a entry
it could be deleted earlier so p never points
to it, and then list_add_tail doesn't hit the
poisoned pointers in the cursor entry.
Of course the simple solution was after about
six much uglier patches that also fixed the
problem in other ways.
diff -Nur linux-2.6.0-test11/fs/libfs.c build-2.6.0-test11-bug/fs/libfs.c
--- linux-2.6.0-test11/fs/libfs.c 2003-11-26 12:42:48.000000000
-0800
+++ build-2.6.0-test11-bug/fs/libfs.c 2003-12-07 13:07:19.000000000
-0800
@@ -79,6 +79,7 @@
loff_t n = file->f_pos - 2;
spin_lock(&dcache_lock);
+ list_del(&cursor->d_child);
p = file->f_dentry->d_subdirs.next;
while (n && p != &file->f_dentry->d_subdirs) {
struct dentry *next;
@@ -87,7 +88,6 @@
n--;
p = p->next;
}
- list_del(&cursor->d_child);
list_add_tail(&cursor->d_child, p);
spin_unlock(&dcache_lock);
}
diff -Nur linux-2.4.23/fs/readdir.c build-2.4.23-skas/fs/readdir.c
--- linux-2.4.23/fs/readdir.c 2002-08-02 17:39:45.000000000 -0700
+++ build-2.4.23-skas/fs/readdir.c 2003-12-10 06:01:05.000000000
-0800
@@ -69,6 +69,7 @@
loff_t n = file->f_pos - 2;
spin_lock(&dcache_lock);
+ list_del(&cursor->d_child);
p = file->f_dentry->d_subdirs.next;
while (n && p != &file->f_dentry->d_subdirs) {
struct dentry *next;
@@ -77,7 +78,6 @@
n--;
p = p->next;
}
- list_del(&cursor->d_child);
list_add_tail(&cursor->d_child, p);
spin_unlock(&dcache_lock);
}
________________________________________________________________
The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next reply other threads:[~2003-12-10 15:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-10 15:36 James W McMechan [this message]
2003-12-10 19:27 ` [uml-devel] [PATCH] fix for: Host panic when UML reads host /dev/shm BlaisorBlade
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=20031210.073651.-388765.0.mcmechanjw@juno.com \
--to=mcmechanjw@juno.com \
--cc=blaisorblade_spam@yahoo.it \
--cc=user-mode-linux-devel@lists.sourceforge.net \
--cc=user-mode-linux-user@lists.sourceforge.net \
/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