netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf 0/3] netfilter: nf_tables: fix some bugs related to dynset
@ 2016-10-22 10:51 Liping Zhang
  2016-10-22 10:51 ` [PATCH nf 1/3] netfilter: nft_dynset: fix panic if NFT_SET_HASH is not enabled Liping Zhang
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Liping Zhang @ 2016-10-22 10:51 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, Liping Zhang

From: Liping Zhang <zlpnobody@gmail.com>

Suppose that the user input the following nft rules, then a dynset expr is
created:
  # nft add rule filter output flow table test { ip daddr counter }

But actually, there are some bugs exist in kernel:
1. If CONFIG_NFT_SET_HASH is not enabled, kernel panic will happen
2. In extreme case, i.e. memory is exhausted, then expr clone will
   fail, this will cause module refcnt leak, memory leak and incorrect
   set's nelems
3. Packets may race when create the new element, and these *racing*
   packets will not be handled properly.

This patch set is aimed to fix these problems.

Liping Zhang (3):
  netfilter: nft_dynset: fix panic if NFT_SET_HASH is not enabled
  netfilter: nf_tables: fix *leak* when expr clone fail
  netfilter: nf_tables: fix race when create new element in dynset

 include/net/netfilter/nf_tables.h |  6 ++++--
 net/netfilter/nf_tables_api.c     | 11 ++++++-----
 net/netfilter/nft_dynset.c        | 19 +++++++++++++------
 net/netfilter/nft_set_hash.c      | 19 ++++++++++++++-----
 net/netfilter/nft_set_rbtree.c    |  2 +-
 5 files changed, 38 insertions(+), 19 deletions(-)

-- 
2.5.5



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

end of thread, other threads:[~2016-10-27 16:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-22 10:51 [PATCH nf 0/3] netfilter: nf_tables: fix some bugs related to dynset Liping Zhang
2016-10-22 10:51 ` [PATCH nf 1/3] netfilter: nft_dynset: fix panic if NFT_SET_HASH is not enabled Liping Zhang
2016-10-25 14:25   ` Liping Zhang
2016-10-26 13:14     ` Liping Zhang
2016-10-22 10:51 ` [PATCH nf 2/3] netfilter: nf_tables: fix *leak* when expr clone fail Liping Zhang
2016-10-22 10:51 ` [PATCH nf 3/3] netfilter: nf_tables: fix race when create new element in dynset Liping Zhang
2016-10-27 16:23 ` [PATCH nf 0/3] netfilter: nf_tables: fix some bugs related to dynset Pablo Neira Ayuso

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