mirror of
https://github.com/torvalds/linux.git
synced 2025-08-15 14:11:42 +02:00
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: d8d871a35c
("netfilter: nft_set_pipapo: merge pipapo_get/lookup")
Signed-off-by: Florian Westphal <fw@strlen.de>
This commit is contained in:
parent
d7e82594a4
commit
30c1d25b98
1 changed files with 2 additions and 3 deletions
|
@ -426,10 +426,9 @@ static struct nft_pipapo_elem *pipapo_get(const struct nft_pipapo_match *m,
|
|||
|
||||
local_bh_disable();
|
||||
|
||||
if (unlikely(!raw_cpu_ptr(m->scratch)))
|
||||
goto out;
|
||||
|
||||
scratch = *raw_cpu_ptr(m->scratch);
|
||||
if (unlikely(!scratch))
|
||||
goto out;
|
||||
|
||||
map_index = scratch->map_index;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue