[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1338353137.2760.7.camel@edumazet-glaptop>
Date: Wed, 30 May 2012 06:45:37 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jesper Dangaard Brouer <brouer@...hat.com>
Cc: christoph.paasch@...ouvain.be, netdev@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Martin Topholm <mph@...h.dk>, Florian Westphal <fw@...len.de>,
opurdila@...acom.com,
Hans Schillstrom <hans.schillstrom@...csson.com>,
Andi Kleen <andi@...stfloor.org>
Subject: Re: [RFC PATCH 0/2] Faster/parallel SYN handling to mitigate SYN
floods
On Tue, 2012-05-29 at 22:17 +0200, Jesper Dangaard Brouer wrote:
> On Mon, 2012-05-28 at 18:14 +0200, Christoph Paasch wrote:
>
> > Concerning (1):
> > I think, there are places where you may have troube because you don't
> > hold the lock.
> > E.g., in tcp_make_synack (called by tcp_v4_send_synack from your
> > tcp_v4_syn_conn_limit) there is:
> >
> > if (sk->sk_userlocks & SOCK_RCVBUF_LOCK &&
> > (req->window_clamp > tcp_full_space(sk) ||
> > req->window_clamp == 0))
> > req->window_clamp = tcp_full_space(sk);
> >
> > Thus, tcp_full_space(sk) may have different values between the check and
> > setting req->window_clamp.
>
> This should be simply solved by using a local stack variable, for
> storing the result from tcp_full_space(sk). Its likely that GCC already
> does this behind our back.
>
Thats not the proper way to handle that situation.
A local stack variable makes no such guarantee. You need ACCESS_ONCE().
This is exactly the kind of things that RCU takes care of.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists