Re: Oops in 2.2.15pre7

From: kuznet@ms2.inr.ac.ru
Date: Sun Feb 20 2000 - 12:13:25 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.

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/



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