OSDN Git Service

netfilter: nf_conncount: fix unexpected permanent node of list.
authorTaehee Yoo <ap420073@gmail.com>
Sun, 4 Nov 2018 18:44:39 +0000 (03:44 +0900)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 12 Nov 2018 15:05:01 +0000 (16:05 +0100)
commit3c5cdb17c3be76714dfd0d03e384f70579545614
treeba33fdfa2e401242bdfc79db4c7334cb15ebc340
parent31568ec09ea02a050249921698c9729419539cce
netfilter: nf_conncount: fix unexpected permanent node of list.

When list->count is 0, the list is deleted by GC. But list->count is
never reached 0 because initial count value is 1 and it is increased
when node is inserted. So that initial value of list->count should be 0.

Originally GC always finds zero count list through deleting node and
decreasing count. However, list may be left empty since node insertion
may fail eg.  allocaton problem. In order to solve this problem, GC
routine also finds zero count list without deleting node.

Fixes: cb2b36f5a97d ("netfilter: nf_conncount: Switch to plain list")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conncount.c