]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
netfilter: nf_conncount: fix argument order to find_next_bit
authorFlorian Westphal <fw@strlen.de>
Fri, 28 Dec 2018 00:24:49 +0000 (01:24 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 29 Dec 2018 01:45:22 +0000 (02:45 +0100)
Size and 'next bit' were swapped, this bug could cause worker to
reschedule itself even if system was idle.

Fixes: 5c789e131cbb9 ("netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search")
Reviewed-by: Shawn Bohrer <sbohrer@cloudflare.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conncount.c

index f0b05dfebc6e1ab816ec9f9ca52d8839a341b04b..7554c56b2e63c8a7c1a53b9ce0b21b126d54b079 100644 (file)
@@ -488,7 +488,7 @@ static void tree_gc_worker(struct work_struct *work)
        clear_bit(tree, data->pending_trees);
 
        next_tree = (tree + 1) % CONNCOUNT_SLOTS;
-       next_tree = find_next_bit(data->pending_trees, next_tree, CONNCOUNT_SLOTS);
+       next_tree = find_next_bit(data->pending_trees, CONNCOUNT_SLOTS, next_tree);
 
        if (next_tree < CONNCOUNT_SLOTS) {
                data->gc_tree = next_tree;