]> git.ipfire.org Git - thirdparty/nftables.git/commit
mnl: fix crashes when using sets with many elements
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 23 Jul 2014 11:20:50 +0000 (13:20 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 25 Jul 2014 01:41:17 +0000 (03:41 +0200)
commit371fdadfafd64b3e364f91a21dac231a16622736
tree9e43215af6d95f16ebed09b120a31fec8ca26d83
parente2b60d54ab2f580cb4aef5a01c7b36a02aee6cc6
mnl: fix crashes when using sets with many elements

nft crashes when adding many elements into a set for two reasons:

1) The overflow of the nla_len field for the NFTA_SET_ELEM_LIST_ELEMENTS
   attribute.

2) Out-of-bound memory writes to the reserved area for the netlink
   message, which is solved by the patch entitled ("mnl: introduce
   NFT_NLMSG_MAXSIZE").

This patch adds the corresponding nla_len overflow check for
NFTA_SET_ELEM_LIST_ELEMENTS and it splits the elements in several
netlink messages. This should be enough when set updates are handled
by the transaction infrastructure.

With this patch, nft should be now capable of adding an unlimited
number of elements to a given set.

Fixes: https://bugzilla.netfilter.org/show_bug.cgi?id=898
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/mnl.c