Commit 8ced425
tun: use socket locks for sk_{attach,detatch}_filter
This reverts commit 5a5abb1 ("tun, bpf: fix suspicious RCU usage
in tun_{attach, detach}_filter") and replaces it to use lock_sock around
sk_{attach,detach}_filter. The checks inside filter.c are updated with
lockdep_sock_is_held to check for proper socket locks.
It keeps the code cleaner by ensuring that only one lock governs the
socket filter instead of two independent locks.
Cc: Daniel Borkmann <[email protected]>
Signed-off-by: Hannes Frederic Sowa <[email protected]>
Signed-off-by: David S. Miller <[email protected]>1 parent 1e1d04e commit 8ced425
3 files changed
+22
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
625 | | - | |
626 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
627 | 628 | | |
628 | 629 | | |
629 | 630 | | |
| |||
1824 | 1825 | | |
1825 | 1826 | | |
1826 | 1827 | | |
1827 | | - | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
1828 | 1831 | | |
1829 | 1832 | | |
1830 | 1833 | | |
| |||
1837 | 1840 | | |
1838 | 1841 | | |
1839 | 1842 | | |
1840 | | - | |
1841 | | - | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
1842 | 1846 | | |
1843 | 1847 | | |
1844 | 1848 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
469 | | - | |
470 | 468 | | |
471 | 469 | | |
472 | 470 | | |
473 | 471 | | |
474 | | - | |
475 | | - | |
476 | 472 | | |
477 | 473 | | |
478 | 474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1149 | 1149 | | |
1150 | 1150 | | |
1151 | 1151 | | |
1152 | | - | |
1153 | | - | |
| 1152 | + | |
1154 | 1153 | | |
1155 | 1154 | | |
1156 | 1155 | | |
| |||
1166 | 1165 | | |
1167 | 1166 | | |
1168 | 1167 | | |
1169 | | - | |
| 1168 | + | |
| 1169 | + | |
1170 | 1170 | | |
| 1171 | + | |
1171 | 1172 | | |
1172 | 1173 | | |
1173 | 1174 | | |
| |||
1246 | 1247 | | |
1247 | 1248 | | |
1248 | 1249 | | |
1249 | | - | |
1250 | | - | |
| 1250 | + | |
1251 | 1251 | | |
1252 | 1252 | | |
1253 | 1253 | | |
1254 | 1254 | | |
1255 | 1255 | | |
1256 | 1256 | | |
1257 | 1257 | | |
1258 | | - | |
| 1258 | + | |
1259 | 1259 | | |
1260 | 1260 | | |
1261 | 1261 | | |
1262 | 1262 | | |
1263 | 1263 | | |
1264 | 1264 | | |
1265 | 1265 | | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
| 1266 | + | |
1272 | 1267 | | |
1273 | 1268 | | |
1274 | 1269 | | |
| |||
1314 | 1309 | | |
1315 | 1310 | | |
1316 | 1311 | | |
1317 | | - | |
| 1312 | + | |
1318 | 1313 | | |
1319 | 1314 | | |
1320 | 1315 | | |
| |||
2255 | 2250 | | |
2256 | 2251 | | |
2257 | 2252 | | |
2258 | | - | |
| 2253 | + | |
2259 | 2254 | | |
2260 | 2255 | | |
2261 | 2256 | | |
2262 | 2257 | | |
2263 | 2258 | | |
2264 | 2259 | | |
2265 | 2260 | | |
2266 | | - | |
| 2261 | + | |
| 2262 | + | |
2267 | 2263 | | |
2268 | 2264 | | |
2269 | 2265 | | |
| |||
2272 | 2268 | | |
2273 | 2269 | | |
2274 | 2270 | | |
2275 | | - | |
2276 | | - | |
2277 | | - | |
2278 | | - | |
2279 | | - | |
2280 | | - | |
| 2271 | + | |
2281 | 2272 | | |
2282 | 2273 | | |
2283 | 2274 | | |
| |||
2288 | 2279 | | |
2289 | 2280 | | |
2290 | 2281 | | |
2291 | | - | |
| 2282 | + | |
2292 | 2283 | | |
2293 | 2284 | | |
2294 | 2285 | | |
| |||
0 commit comments