]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: ctnetlink: fix refcnt leak in dying/unconfirmed list dumper
authorFlorian Westphal <fw@strlen.de>
Sun, 8 Jun 2014 09:41:23 +0000 (11:41 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 16 Jun 2014 10:51:36 +0000 (12:51 +0200)
commit04ac2997c5e534108fa9acb6262e7b3c38af777c
tree1256bde8377eda4f1ca29a232eaaa0e8a3d13e22
parent3ce20f8aabd0ddca0c226fd10859c380a7a9d833
netfilter: ctnetlink: fix refcnt leak in dying/unconfirmed list dumper

'last' keeps track of the ct that had its refcnt bumped during previous
dump cycle.  Thus it must not be overwritten until end-of-function.

Another (unrelated, theoretical) issue: Don't attempt to bump refcnt of a conntrack
whose reference count is already 0.  Such conntrack is being destroyed
right now, its memory is freed once we release the percpu dying spinlock.

Fixes: fead3fbc ('netfilter: conntrack: spinlock per cpu to protect special lists.')
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_netlink.c