Commit d1cacd7
committed
netdev: prevent accessing NAPI instances from another namespace
The NAPI IDs were not fully exposed to user space prior to the netlink
API, so they were never namespaced. The netlink API must ensure that
at the very least NAPI instance belongs to the same netns as the owner
of the genl sock.
napi_by_id() can become static now, but it needs to move because of
dev_get_by_napi_id().
Cc: [email protected]
Fixes: 1287c1a ("netdev-genl: Support setting per-NAPI config values")
Fixes: 27f91aa ("netdev-genl: Add netlink framework functions for napi")
Reviewed-by: Sridhar Samudrala <[email protected]>
Reviewed-by: Joe Damato <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>1 parent db78475 commit d1cacd7
3 files changed
+34
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
756 | 786 | | |
757 | 787 | | |
758 | 788 | | |
| |||
6293 | 6323 | | |
6294 | 6324 | | |
6295 | 6325 | | |
6296 | | - | |
6297 | | - | |
6298 | | - | |
6299 | | - | |
6300 | | - | |
6301 | | - | |
6302 | | - | |
6303 | | - | |
6304 | | - | |
6305 | | - | |
6306 | | - | |
6307 | | - | |
6308 | | - | |
6309 | 6326 | | |
6310 | 6327 | | |
6311 | 6328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
272 | | - | |
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | 170 | | |
173 | 171 | | |
174 | 172 | | |
| |||
234 | 232 | | |
235 | 233 | | |
236 | 234 | | |
237 | | - | |
| 235 | + | |
238 | 236 | | |
239 | 237 | | |
240 | 238 | | |
| |||
355 | 353 | | |
356 | 354 | | |
357 | 355 | | |
358 | | - | |
| 356 | + | |
359 | 357 | | |
360 | 358 | | |
361 | 359 | | |
| |||
0 commit comments