summaryrefslogtreecommitdiffstats
path: root/net/packet
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2020-04-01 17:14:38 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2020-04-05 23:26:36 +0200
commit72239f2795fab9a58633bd0399698ff7581534a3 (patch)
tree73571110e3295beee510f20861647fd329c727ad /net/packet
parent0452800f6db4ed0a42ffb15867c0acfd68829f6a (diff)
downloadlinux-stable-72239f2795fab9a58633bd0399698ff7581534a3.tar.gz
linux-stable-72239f2795fab9a58633bd0399698ff7581534a3.tar.bz2
linux-stable-72239f2795fab9a58633bd0399698ff7581534a3.zip
netfilter: nft_set_rbtree: Drop spurious condition for overlap detection on insertion
Case a1. for overlap detection in __nft_rbtree_insert() is not a valid one: start-after-start is not needed to detect any type of interval overlap and it actually results in a false positive if, while descending the tree, this is the only step we hit after starting from the root. This introduced a regression, as reported by Pablo, in Python tests cases ip/ip.t and ip/numgen.t: ip/ip.t: ERROR: line 124: add rule ip test-ip4 input ip hdrlength vmap { 0-4 : drop, 5 : accept, 6 : continue } counter: This rule should not have failed. ip/numgen.t: ERROR: line 7: add rule ip test-ip4 pre dnat to numgen inc mod 10 map { 0-5 : 192.168.10.100, 6-9 : 192.168.20.200}: This rule should not have failed. Drop case a1. and renumber others, so that they are a bit clearer. In order for these diagrams to be readily understandable, a bigger rework is probably needed, such as an ASCII art of the actual rbtree (instead of a flattened version). Shell script test sets/0044interval_overlap_0 should cover all possible cases for false negatives, so I consider that test case still sufficient after this change. v2: Fix comments for cases a3. and b3. Reported-by: Pablo Neira Ayuso <pablo@netfilter.org> Fixes: 7c84d41416d8 ("netfilter: nft_set_rbtree: Detect partial overlaps on insertion") Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/packet')
0 files changed, 0 insertions, 0 deletions