Re: Oops in 2.2.15pre7

From: Oleg Drokin (green@ccssu.crimea.ua)
Date: Mon Feb 21 2000 - 02:42:05 EST


Hello!

> > > save_flags(flags);
> > > cli();
> > > *fp = fa->fa_next;
> > > restore_flags(flags);
> > > kfree(fa);
> > > return 1;
> > > is safe even SMP since the cli/restore_flags means that we cannot be part
> > > way down a queue walk when the entry is freed.
> synchronize_irq() will be enough, really. 2.2 still relies on compiler
> and cpu stupidity in lots of places, so that it is meaningless to add
> cli() in this one place.
Do you mean that this will be enough, and similar thing in tty_io.c?
Ain't this leaves small window for race, still?

--- net/socket.c.orig Mon Feb 21 09:20:38 2000
+++ net/socket.c Mon Feb 21 09:28:40 2000
@@ -68,6 +68,7 @@
 #include <linux/wanrouter.h>
 #include <linux/init.h>
 #include <linux/poll.h>
+#include <asm/hardirq.h>
 
 #if defined(CONFIG_KMOD) && defined(CONFIG_NET)
 #include <linux/kmod.h>
@@ -516,6 +517,7 @@
                 if (fa->fa_file==filp)
                         break;
         
+ synchronize_irq();
         if(on)
         {
                 if(fa!=NULL)

> That it is bug. lock_sock() protects socket of another events,
> rather than synchronizes to another threads. It can be called only
> from process context and will result in crash, when called from BH.
> In this case it is called even from IRQ. 8)8)
Ah, ok.

Bye,
    Oleg

-- 
 [RAVE *SUCKS* TEAM] [Team $Ui(iDE] [Trans-M Must Die!] [Sepultura Fans Team]
                         [Tolkien forever team]

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:26 EST