Commit 8b5995d
netfilter: helper: Add the rcu lock when call __nf_conntrack_helper_find
When invoke __nf_conntrack_helper_find, it needs the rcu lock to
protect the helper module which would not be unloaded.
Now there are two caller nf_conntrack_helper_try_module_get and
ctnetlink_create_expect which don't hold rcu lock. And the other
callers left like ctnetlink_change_helper, ctnetlink_create_conntrack,
and ctnetlink_glue_attach_expect, they already hold the rcu lock
or spin_lock_bh.
Remove the rcu lock in functions nf_ct_helper_expectfn_find_by_name
and nf_ct_helper_expectfn_find_by_symbol. Because they return one pointer
which needs rcu lock, so their caller should hold the rcu lock, not in
these two functions.
Signed-off-by: Gao Feng <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>1 parent 97aae0d commit 8b5995d
2 files changed
+20
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
164 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
165 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
166 | 173 | | |
167 | 174 | | |
168 | 175 | | |
169 | 176 | | |
170 | 177 | | |
| 178 | + | |
| 179 | + | |
171 | 180 | | |
172 | 181 | | |
173 | 182 | | |
| |||
311 | 320 | | |
312 | 321 | | |
313 | 322 | | |
| 323 | + | |
314 | 324 | | |
315 | 325 | | |
316 | 326 | | |
317 | 327 | | |
318 | 328 | | |
319 | 329 | | |
320 | | - | |
321 | 330 | | |
322 | 331 | | |
323 | 332 | | |
324 | 333 | | |
325 | 334 | | |
326 | 335 | | |
327 | | - | |
328 | 336 | | |
329 | 337 | | |
330 | 338 | | |
331 | 339 | | |
| 340 | + | |
332 | 341 | | |
333 | 342 | | |
334 | 343 | | |
335 | 344 | | |
336 | 345 | | |
337 | 346 | | |
338 | | - | |
339 | 347 | | |
340 | 348 | | |
341 | 349 | | |
342 | 350 | | |
343 | 351 | | |
344 | 352 | | |
345 | | - | |
346 | 353 | | |
347 | 354 | | |
348 | 355 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3133 | 3133 | | |
3134 | 3134 | | |
3135 | 3135 | | |
| 3136 | + | |
3136 | 3137 | | |
3137 | 3138 | | |
3138 | 3139 | | |
3139 | 3140 | | |
3140 | 3141 | | |
3141 | 3142 | | |
| 3143 | + | |
3142 | 3144 | | |
3143 | 3145 | | |
3144 | 3146 | | |
3145 | 3147 | | |
3146 | 3148 | | |
| 3149 | + | |
3147 | 3150 | | |
3148 | 3151 | | |
3149 | 3152 | | |
3150 | 3153 | | |
3151 | | - | |
| 3154 | + | |
3152 | 3155 | | |
| 3156 | + | |
3153 | 3157 | | |
3154 | 3158 | | |
3155 | 3159 | | |
| |||
3159 | 3163 | | |
3160 | 3164 | | |
3161 | 3165 | | |
3162 | | - | |
| 3166 | + | |
3163 | 3167 | | |
3164 | 3168 | | |
3165 | 3169 | | |
3166 | 3170 | | |
| 3171 | + | |
| 3172 | + | |
3167 | 3173 | | |
3168 | 3174 | | |
3169 | 3175 | | |
| |||
0 commit comments