Commit f969eb8
netfilter: nf_tables: Fix potential data-race in __nft_expr_type_get()
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]>1 parent 19fa4f2 commit f969eb8
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3060 | 3060 | | |
3061 | 3061 | | |
3062 | 3062 | | |
3063 | | - | |
| 3063 | + | |
3064 | 3064 | | |
3065 | 3065 | | |
3066 | 3066 | | |
| |||
3092 | 3092 | | |
3093 | 3093 | | |
3094 | 3094 | | |
| 3095 | + | |
3095 | 3096 | | |
3096 | | - | |
| 3097 | + | |
| 3098 | + | |
3097 | 3099 | | |
| 3100 | + | |
| 3101 | + | |
3098 | 3102 | | |
3099 | 3103 | | |
3100 | 3104 | | |
| |||
0 commit comments