Commit 0840556
net: Protect dev->name by seqlock.
We will convert ioctl(SIOCGARP) to RCU, and then we need to copy
dev->name which is currently protected by rtnl_lock().
This patch does the following:
1) Add seqlock netdev_rename_lock to protect dev->name
2) Add netdev_copy_name() that copies dev->name to buffer
under netdev_rename_lock
3) Use netdev_copy_name() in netdev_get_name() and drop
devnet_rename_sem
Suggested-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/netdev/CANn89iJEWs7AYSJqGCUABeVqOCTkErponfZdT5kV-iD=-SajnQ@mail.gmail.com/
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20240430015813.71143-7-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent a428bfc commit 0840556
2 files changed
Lines changed: 24 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3136 | 3136 | | |
3137 | 3137 | | |
3138 | 3138 | | |
| 3139 | + | |
3139 | 3140 | | |
3140 | 3141 | | |
3141 | 3142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
943 | 955 | | |
944 | 956 | | |
945 | 957 | | |
| |||
951 | 963 | | |
952 | 964 | | |
953 | 965 | | |
954 | | - | |
955 | 966 | | |
956 | 967 | | |
957 | 968 | | |
| |||
960 | 971 | | |
961 | 972 | | |
962 | 973 | | |
963 | | - | |
| 974 | + | |
964 | 975 | | |
965 | 976 | | |
966 | 977 | | |
967 | 978 | | |
968 | | - | |
969 | 979 | | |
970 | 980 | | |
971 | 981 | | |
| |||
1217 | 1227 | | |
1218 | 1228 | | |
1219 | 1229 | | |
| 1230 | + | |
1220 | 1231 | | |
| 1232 | + | |
| 1233 | + | |
1221 | 1234 | | |
1222 | 1235 | | |
1223 | 1236 | | |
| |||
1257 | 1270 | | |
1258 | 1271 | | |
1259 | 1272 | | |
| 1273 | + | |
1260 | 1274 | | |
| 1275 | + | |
1261 | 1276 | | |
1262 | 1277 | | |
1263 | 1278 | | |
| |||
11403 | 11418 | | |
11404 | 11419 | | |
11405 | 11420 | | |
11406 | | - | |
| 11421 | + | |
| 11422 | + | |
| 11423 | + | |
11407 | 11424 | | |
| 11425 | + | |
| 11426 | + | |
11408 | 11427 | | |
11409 | 11428 | | |
11410 | 11429 | | |
| |||
0 commit comments