[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130628163458.GB651@order.stressinduktion.org>
Date: Fri, 28 Jun 2013 18:34:58 +0200
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: Eric Dumazet <eric.dumazet@...il.com>,
Changli Gao <xiaosuo@...il.com>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] net: Check the argument for listen(2)
On Fri, Jun 28, 2013 at 06:32:34PM +0200, Hannes Frederic Sowa wrote:
> On Fri, Jun 28, 2013 at 09:29:02AM -0700, Eric Dumazet wrote:
> > On Sat, 2013-06-29 at 00:14 +0800, Changli Gao wrote:
> > > --- a/net/ipv4/af_inet.c
> > > +++ b/net/ipv4/af_inet.c
> > > @@ -198,6 +198,9 @@ int inet_listen(struct socket *sock, int backlog)
> > > unsigned char old_state;
> > > int err;
> > >
> > > + if (backlog >= (1 << 16))
> > > + return EINVAL;
> > > +
> > > lock_sock(sk);
> > >
> > > err = -EINVAL;
> >
> > This seems pretty buggy to me.
> >
> > 1) EINVAL is not -EINVAL
> >
> > 2) This might break existing applications.
>
> Yes, we should clamp the value to netdev_max_backlog.
Nonsense, somaxconn would make more sense.
Sorry,
Hannes
--
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