Commit 65676da
committed
netfilter: nf_tables: Fix potential data-race in __nft_expr_type_get()
jira LE-1907
cve CVE-2024-27020
Rebuild_History Non-Buildable kernel-5.14.0-427.33.1.el9_4
commit-author Ziyang Xuan <william.xuanziyang@huawei.com>
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 <william.xuanziyang@huawei.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit f969eb8)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>1 parent 7bc4f3e commit 65676da
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2811 | 2811 | | |
2812 | 2812 | | |
2813 | 2813 | | |
2814 | | - | |
| 2814 | + | |
2815 | 2815 | | |
2816 | 2816 | | |
2817 | 2817 | | |
| |||
2843 | 2843 | | |
2844 | 2844 | | |
2845 | 2845 | | |
| 2846 | + | |
2846 | 2847 | | |
2847 | | - | |
| 2848 | + | |
| 2849 | + | |
2848 | 2850 | | |
| 2851 | + | |
| 2852 | + | |
2849 | 2853 | | |
2850 | 2854 | | |
2851 | 2855 | | |
| |||
0 commit comments