Re: Fix for thread+network crashes in 2.0/2.1?

A.N.Kuznetsov (
Mon, 2 Mar 1998 17:26:56 +0300 (MSK)


> > Before "struct socket" is destoyed all the references from
> > transport records (struct sock) are invalidated. If x25 does
> > not make it, it is bug in x25.
> But if a task had sleeped on *sk->sleep before, than socket is destroyd and then it is waked up, is there a second reference now?
> > Just set sk->dead=1, and that's all. Is it simple?
> This seems to be done in x.25. But still crashes -:( last checked 2.1.89-5 ).
> Aparrently, the intetention was: if sk->dead is 1, then wake_up's by means of
> the *sk->sleep == sock->wait wait are supressed. But what happens if the
> task is awoken up by means of another wait queue (likely to occur in select,
> as this is made for waiting waiting on multiple different fd's).

Protocols do not sleep (with one exception - netlink) on socket owned
by another process, so that get_fd()...put_fd() protection is enough.
When it is the case playing with i_count DOES take a sense,
but it should be played only in normal kernel mode (not from timer).
The only known (to me :-)) example is netlink and, maybe, future af_unix
datagram socket. Seems, no transports except for local ones need it.

Alexey Kuznetsov

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to