Commit 767d121
committed
netfilter: nftables: fix possible UAF over chains from packet path in netns
Although hooks are released via call_rcu(), chain and rule objects are
immediately released while packets are still walking over these bits.
This patch adds the .pre_exit callback which is invoked before
synchronize_rcu() in the netns framework to stay safe.
Remove a comment which is not valid anymore since the core does not use
synchronize_net() anymore since 8c873e2 ("netfilter: core: free
hooks with call_rcu").
Suggested-by: Florian Westphal <[email protected]>
Fixes: df05ef8 ("netfilter: nf_tables: release objects on netns destruction")
Signed-off-by: Pablo Neira Ayuso <[email protected]>1 parent a3005b0 commit 767d121
1 file changed
+19
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8949 | 8949 | | |
8950 | 8950 | | |
8951 | 8951 | | |
| 8952 | + | |
| 8953 | + | |
| 8954 | + | |
| 8955 | + | |
| 8956 | + | |
| 8957 | + | |
| 8958 | + | |
| 8959 | + | |
| 8960 | + | |
| 8961 | + | |
| 8962 | + | |
8952 | 8963 | | |
8953 | 8964 | | |
8954 | 8965 | | |
| |||
8964 | 8975 | | |
8965 | 8976 | | |
8966 | 8977 | | |
8967 | | - | |
8968 | | - | |
8969 | | - | |
8970 | | - | |
8971 | 8978 | | |
8972 | 8979 | | |
8973 | 8980 | | |
| |||
9016 | 9023 | | |
9017 | 9024 | | |
9018 | 9025 | | |
| 9026 | + | |
| 9027 | + | |
| 9028 | + | |
| 9029 | + | |
| 9030 | + | |
9019 | 9031 | | |
9020 | 9032 | | |
9021 | 9033 | | |
| |||
9029 | 9041 | | |
9030 | 9042 | | |
9031 | 9043 | | |
9032 | | - | |
9033 | | - | |
| 9044 | + | |
| 9045 | + | |
| 9046 | + | |
9034 | 9047 | | |
9035 | 9048 | | |
9036 | 9049 | | |
| |||
0 commit comments