Commit d9a8f26
committed
netfilter: nf_tables: Fix potential data-race in __nft_expr_type_get()
jira VULN-4905
cve CVE-2024-27020
commit-author Ziyang Xuan <[email protected]>
commit f969eb8
nft_unregister_expr() can concurrent with __nft_expr_type_get(),
and there is not any protection when iterate over nf_tables_expressions
list in __nft_expr_type_get(). Therefore, there is potential data-race
of nf_tables_expressions list entry.
Use list_for_each_entry_rcu() to iterate over nf_tables_expressions
list in __nft_expr_type_get(), and use rcu_read_lock() in the caller
nft_expr_type_get() to protect the entire type query process.
Fixes: ef1f7df ("netfilter: nf_tables: expression ops overloading")
Signed-off-by: Ziyang Xuan <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
(cherry picked from commit f969eb8)
Signed-off-by: Greg Rose <[email protected]>1 parent 8710d34 commit d9a8f26
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2462 | 2462 | | |
2463 | 2463 | | |
2464 | 2464 | | |
2465 | | - | |
| 2465 | + | |
2466 | 2466 | | |
2467 | 2467 | | |
2468 | 2468 | | |
| |||
2494 | 2494 | | |
2495 | 2495 | | |
2496 | 2496 | | |
| 2497 | + | |
2497 | 2498 | | |
2498 | | - | |
| 2499 | + | |
| 2500 | + | |
2499 | 2501 | | |
| 2502 | + | |
| 2503 | + | |
2500 | 2504 | | |
2501 | 2505 | | |
2502 | 2506 | | |
| |||
0 commit comments