linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] [PATCH] fix for: Host panic when UML reads host /dev/shm
@ 2003-12-10 15:36 James W McMechan
  2003-12-10 19:27 ` BlaisorBlade
  0 siblings, 1 reply; 2+ messages in thread
From: James W McMechan @ 2003-12-10 15:36 UTC (permalink / raw)
  To: blaisorblade_spam; +Cc: user-mode-linux-user, user-mode-linux-devel

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

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

end of thread, other threads:[~2003-12-10 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-10 15:36 [uml-devel] [PATCH] fix for: Host panic when UML reads host /dev/shm James W McMechan
2003-12-10 19:27 ` BlaisorBlade

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox