Messages in this thread | | | From | kuznet@ms2 ... | Subject | Re: Oops in 2.2.15pre7 | Date | Sun, 20 Feb 2000 20:13:25 +0300 (MSK) |
| |
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.
Compare this to the situation with that my patch, which "cleaned" all such places in networking for 2.2. Torvalds did not eat it, and all of such protection were replaced with synchronize.
Though couple of explicit barriers in kill_fasync() will not be redundant in any case.
> What do you say about this? > > --- net/socket.c.orig Sat Feb 19 23:15:54 2000 > +++ net/socket.c Sun Feb 20 12:40:07 2000 > @@ -561,7 +561,9 @@ > /* fall through */ > case 0: > call_kill: > + lock_sock(sock->sk); > kill_fasync(sock->fasync_list, SIGIO); > + release_sock(sock->sk); > break; > } > return 0;
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)
Alexey Kuznetsov
- 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/
| |