netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] segtree: move huge arrays to heap
@ 2017-01-02 19:54 Oleksandr Natalenko
  2017-01-02 19:54 ` [PATCH v2 1/2] utils: provide array allocation wrapper Oleksandr Natalenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Oleksandr Natalenko @ 2017-01-02 19:54 UTC (permalink / raw)
  To: netfilter-devel

While dealing with huge sets, nft may exhaust stack
and trigger segfault. To avoid this, lets move those
huge arrays away from stack to heap.

First patch introduces array allocation helper.

Second patch modifies interval_map_decompose()
function, allocating memory for arrays on head.

Meny thanks to Florian Westphal who helped
to sort this out.

Changelog:

v2: nmemb actually can be 0, so remove that
    assertion

v1: initial submission

Oleksandr Natalenko (2):
  utils: provide array allocation wrapper
  segtree: allocate memory for arrays on heap

 include/utils.h |  1 +
 src/segtree.c   |  8 +++++++-
 src/utils.c     | 10 ++++++++++
 3 files changed, 18 insertions(+), 1 deletion(-)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-03  1:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-02 19:54 [PATCH v2 0/2] segtree: move huge arrays to heap Oleksandr Natalenko
2017-01-02 19:54 ` [PATCH v2 1/2] utils: provide array allocation wrapper Oleksandr Natalenko
2017-01-02 19:54 ` [PATCH v2 2/2] segtree: allocate memory for arrays on heap Oleksandr Natalenko
2017-01-03  1:54 ` [PATCH v2 0/2] segtree: move huge arrays to heap Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).