Re: LSF and SOCK_PACKET

Andi Kleen (ak@muc.de)
Thu, 15 Oct 1998 21:50:09 +0200


On Thu, Oct 15, 1998 at 09:26:26PM +0200, kuznet@ms2.inr.ac.ru wrote:
> Hello!
>
> > - There are races while removing/setting the new filter (the new filter
> > can be used with the old sk->filter size, the old filter is still available
> > to interrupts after it is freed etc. etc.). The same in
> > SO_DETACH_FILTER (the filter is freed first then sk->filter is cleared)
>
> Oops 8) Seems, it should be reorganized to use single pointer
> and to make xchg() (I still hope xchg() is atomic on pointers 8))

Ooops, there is an even worse bug. TCP may clone sockets including
the filter, but there is no reference counter in the filter data (so
it can be freed on either socket and still referenced on the other)
Seems I missed that in my other patch (which just used start/end_bh_atomic)

>
> Will you fix it? I had to modify it a bit to make it useful
> for anything but raw packet socket in any case.
> Now it is fed with packets without IP headers for udp/tcp/raw,
> and without ll headers for dgram, so that bpf is practically useless.
> I can send you my local version tomorrow and will put new libpcap/tcpdump
> to ftp.inr.ac.ru too.

Seems mails crossed. Send me your version and I will go over it and merge
them.

-Andi

-
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/