ipvlan: Make the addrs_lock be per port
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8230819494b3bf284ca7262ac5f877333147b937 · < 6a81e2db096913d7e43aada1c350c1282e76db39| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ipvlan: Make the addrs_lock be per port
Make the addrs_lock be per port, not per ipvlan dev.
Initial code seems to be written in the assumption, that any address change must occur under RTNL. But it is not so for the case of IPv6. So
1) Introduce per-port addrs_lock.
2) It was needed to fix places where it was forgotten to take lock (ipvlan_open/ipvlan_close)
This appears to be a very minor problem though. Since it's highly unlikely that ipvlan_add_addr() will be called on 2 CPU simultaneously. But nevertheless, this could cause:
1) False-negative of ipvlan_addr_busy(): one interface iterated through all port->ipvlans + ipvlan->addrs under some ipvlan spinlock, and another added IP under its own lock. Though this is only possible for IPv6, since looks like only ipvlan_addr6_event() can be called without rtnl_lock.
From the CVE record · Linux
The Linux kernel’s ipvlan component has a locking race during concurrent address changes, particularly for IPv6 changes that can occur without the RTNL lock. The race can cause an address-busy check to miss an address or affect address hash-table updates; the input does not specify an attacker path, authentication requirement, or user interaction.
Operators running Linux kernels that use ipvlan should check whether their kernel includes the fix; affected versions are not specified.