Subject: Re: [PATCH 2/8] dccp: use limited socket backlog

From: Zhu Yi <[email-masked]>
Date: Wed, 03 Mar 2010 15:43:48 +0800

On Wed, 2010-03-03 at 14:56 +0800, Eric Dumazet wrote:
> Le mercredi 03 mars 2010 à 14:35 +0800, Zhu Yi a écrit :
> > Make dccp adapt to the limited socket backlog change.
> > 
> > Cc: Arnaldo Carvalho de Melo <[email-masked]>
> > Signed-off-by: Zhu Yi <[email-masked]>
> > ---
> >  net/dccp/minisocks.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c
> > index af226a0..0d508c3 100644
> > --- a/net/dccp/minisocks.c
> > +++ b/net/dccp/minisocks.c
> > @@ -254,7 +254,7 @@ int dccp_child_process(struct sock *parent, struct sock *child,
> >  		 * in main socket hash table and lock on listening
> >  		 * socket does not protect us more.
> >  		 */
> > -		sk_add_backlog(child, skb);
> > +		__sk_add_backlog(child, skb);
> >  	}
> >  
> >  	bh_unlock_sock(child);
> 
> I dont understand this patch.
> 
> You make dccp vulnerable to memory exhaustion, I thought you wanted to
> solve this problem.
> 
> It should therefore be named "dccp: use unlimited socket backlog"
> 
> (And this sounds not so sexy :) )

dccp uses sk_receive_skb() which calls sk_add_backlog() that I fixed in
the first patch. This patch here handles a different case, when the
parent sk is in the LISTEN state and we want the child to process the
packet. Should the backlog limit be applied here? I'm waiting for
comments.

Thanks,
-yi