Skip to content

Commit 30c1d25

Browse files
author
Florian Westphal
committed
netfilter: nft_set_pipapo: fix null deref for empty set
Blamed commit broke the check for a null scratch map: - if (unlikely(!m || !*raw_cpu_ptr(m->scratch))) + if (unlikely(!raw_cpu_ptr(m->scratch))) This should have been "if (!*raw_ ...)". Use the pattern of the avx2 version which is more readable. This can only be reproduced if avx2 support isn't available. Fixes: d8d871a ("netfilter: nft_set_pipapo: merge pipapo_get/lookup") Signed-off-by: Florian Westphal <[email protected]>
1 parent d7e8259 commit 30c1d25

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

net/netfilter/nft_set_pipapo.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,9 @@ static struct nft_pipapo_elem *pipapo_get(const struct nft_pipapo_match *m,
426426

427427
local_bh_disable();
428428

429-
if (unlikely(!raw_cpu_ptr(m->scratch)))
430-
goto out;
431-
432429
scratch = *raw_cpu_ptr(m->scratch);
430+
if (unlikely(!scratch))
431+
goto out;
433432

434433
map_index = scratch->map_index;
435434

0 commit comments

Comments
 (0)