Patchwork [2/8] dccp: use limited socket backlog

login
register
mail settings
Submitter Zhu Yi
Date March 3, 2010, 6:35 a.m.
Message ID <1267598111-12503-2-git-send-email-yi.zhu@intel.com>
Download mbox | patch
Permalink /patch/46760/
State Superseded
Delegated to: David Miller
Headers show

Comments

Zhu Yi - March 3, 2010, 6:35 a.m.
Make dccp adapt to the limited socket backlog change.

Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 net/dccp/minisocks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Eric Dumazet - March 3, 2010, 6:56 a.m.
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 <acme@ghostprotocols.net>
> Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> ---
>  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 :) )


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zhu Yi - March 3, 2010, 7:43 a.m.
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 <acme@ghostprotocols.net>
> > Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> > ---
> >  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


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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);