lkml.org 
[lkml]   [1999]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] af_unix fix for a panic a DoS and a memory leak [Re:
On Wed, 3 Mar 1999 kuznet@ms2.inr.ac.ru wrote:

>The only race is in limit checking and it is harmless,

Yes.

>start_bh_atomic() is pretty expensive on SMP boxen. I'd avoid this,
>when it is possible.

In the best case is not too expensive but ok.

>Ough, guys: it is wrong. Let's make it in more liberal way yet,
>f.e.
>
>struct wait_queue *unix_global_ack_queue;
>....
>
>restart:
> /* Find listening sock */
> other=unix_find_other(sunaddr, addr_len, sk->type, hash, &err);
>
> if (other && other->ack_backlog >= other->max_ack_backlog) {
> if (other->dead || other->state != TCP_LISTEN) {
> unix_unlock(other);
> return -ECONNREFUSED;
> }
>
> unix_unlock(other);
>
> if (nonblock)
> return -EAGAIN;
> sleep_on_interruptible(&unix_global_ack_queue);
> if (signal_pending(current))
> return -ERESTARTSYS;
> goto restart;
> }
>
> /* create new sock for complete connection */
> newsk = unix_create1(NULL, 1);
>
>....
>and wake_up_interruptible(&unix_global_ack_queue) on all --ack_backlog

Make sense, (it's what I suggested to AV yesterday, if we want to block
somewhere, better to block in connect()).

Really I liked quite much also my brute way.

How could we detect and smart-avoiding synflooding btw? I didn't
understood this very well. I understood we should change some skb-queue
design but not a lot more...

Andrea Arcangeli


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

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.093 / U:0.524 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site