lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130319142228.GB23421@order.stressinduktion.org>
Date:	Tue, 19 Mar 2013 15:22:28 +0100
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
	jbrouer@...hat.com
Subject: Re: [PATCH net] inet: limit length of fragment queue hash table bucket lists

On Tue, Mar 19, 2013 at 07:15:43AM -0700, Eric Dumazet wrote:
> On Tue, 2013-03-19 at 10:03 -0400, David Miller wrote:
> > From: Hannes Frederic Sowa <hannes@...essinduktion.org>
> > Date: Fri, 15 Mar 2013 22:32:30 +0100
> > 
> > > This patch introduces a constant limit of the fragment queue hash
> > > table bucket list lengths. Currently the limit 128 is choosen somewhat
> > > arbitrary and just ensures that we can fill up the fragment cache with
> > > empty packets up to the default ip_frag_high_thresh limits. It should
> > > just protect from list iteration eating considerable amounts of cpu.
> > > 
> > > If we reach the maximum length in one hash bucket a warning is printed.
> > > This is implemented on the caller side of inet_frag_find to distinguish
> > > between the different users of inet_fragment.c.
> > > 
> > > I dropped the out of memory warning in the ipv4 fragment lookup path,
> > > because we already get a warning by the slab allocator.
> > > 
> > > Cc: Eric Dumazet <eric.dumazet@...il.com>
> > > Cc: Jesper Dangaard Brouer <jbrouer@...hat.com>
> > > Signed-off-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
> > 
> > This looks mostly fine to me, Eric could you give it a quick review?
> > 
> 
> Sure, it looks ok for me
> 
> Acked-by: Eric Dumazet <edumazet@...gle.com>
> 
> > Although one comment from me:
> > 
> > > +/* averaged:
> > > + * max_depth = default ipfrag_high_thresh / INETFRAGS_HASHSZ /
> > > + *	       rounded up (SKB_TRUELEN(0) + sizeof(struct ipq or
> > > + *	       struct frag_queue))
> > > + */
> > > +#define INETFRAGS_MAXDEPTH		128
> > 
> > If we deem this to be the ideal formula, maybe we can maintain it
> > accurately and very cheaply at run time.  We'd do this by adding a
> > handler for the ipfrag_high_thresh sysctl, and use that to recalculate
> > the maxdepth any time ipfrag_high_thresh is changed by the user.
> 
> This can probably be done in a second patch for net-next

I'll rebase the old patch introducing inet_frag_update_high_thresh ontop
this one. I think the dynamic update might be useful if we lower the
maxdepth limit in future.

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ