Commit b0ad3c1
rtnetlink: call validate_linkmsg in rtnl_create_link
validate_linkmsg() was introduced by commit 1840bb1 ("[RTNL]:
Validate hardware and broadcast address attribute for RTM_NEWLINK")
to validate tb[IFLA_ADDRESS/BROADCAST] for existing links. The same
check should also be done for newly created links.
This patch adds validate_linkmsg() call in rtnl_create_link(), to
avoid the invalid address set when creating some devices like:
# ip link add dummy0 type dummy
# ip link add link dummy0 name mac0 address 01:02 type macsec
Fixes: 0e06877 ("[RTNETLINK]: rtnl_link: allow specifying initial device address")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent abaf8d5 commit b0ad3c1
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3285 | 3285 | | |
3286 | 3286 | | |
3287 | 3287 | | |
| 3288 | + | |
3288 | 3289 | | |
3289 | 3290 | | |
3290 | 3291 | | |
| |||
3320 | 3321 | | |
3321 | 3322 | | |
3322 | 3323 | | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
3323 | 3330 | | |
3324 | 3331 | | |
3325 | 3332 | | |
3326 | 3333 | | |
3327 | 3334 | | |
3328 | 3335 | | |
3329 | | - | |
3330 | 3336 | | |
3331 | 3337 | | |
3332 | 3338 | | |
| |||
0 commit comments