We've had a patch[1] from one of the authors of RFC 8981 for some time now that:
- reduces the valid lifetime from 1 week to 2 days,
- limits the number of concurrent temporary addresses per prefix to 2,
- deprecates the use of MD5 as the algorithm for computing the temporary IIDs,
- introduces using different interface-ids for each temporary address,
- respects the list of Reserved IPv6 Interface Identifiers.
I've been testing this solution on my desktop and laptop in CURRENT and STABLE for almost two years now, and so fa,r there have been no issues with this patch. I haven't done any tests where multiple FIBs and VNETs are involved, so the patch probably needs more attention in this regard.
This patch is not mine, but Fernando is not interested in putting it on the Phabricator. At the beginning, he tried to attract the attention of some of our devs and sent a few posts to mailing lists, but it was 5 years ago, and those people were busy. Since we don't have anything better at the moment, it's worth putting it up for discussion.
PR: 245103
Submitted by: Fernando Gont
Update:
I later came up with a patch to adjust MAX_DESYNC_FACTOR upon net.inet6.ip6.temppltime modification. It's likely the indispensable part of the change, so now it's squashed with Fernando's original patch. The currently proposed patch brings the following changes:
- Deprecates the use of MD5 as the algorithm for generating temporary interface identifiers (IIDs) for IPv6 addresses, improving cryptographic robustness.
- Introduces per-address randomized IIDs, ensuring that each temporary address uses a distinct interface identifier to enhance privacy and avoid correlation across addresses.
- Updates the IID generation logic to respect the Reserved IPv6 Interface Identifiers list.
- Enhances sysctl_ip6_temppltime() so that ip6_temp_max_desync_factor is dynamically recalculated whenever ip6_temp_preferred_lifetime is updated via sysctl. This ensures that MAX_DESYNC_FACTOR remains approximately 3/8 of the preferred lifetime plus 5 minutes. DESYNC_FACTOR is also regenerated after each update.
- Timers related to temporary address regeneration were updated to match the design recommendations in RFC 8981.
- A new read-only sysctl variable net.inet6.ip6.temp_max_desync_factor is introduced to expose the computed value of MAX_DESYNC_FACTOR to userland for observability and debugging.
- Input validation to reject temppltime values too small or too large is included.
PR: 245103
Submitted by: Fernando Gont
Following the discussion on IRC comparing D50343 and D49459, I mistakenly removed the reviewers and subscribers from this review, which I now regret. That said, assigning too many reviewers initially was also not ideal.
Please feel free to test and review this code as you see fit, whether you like it or not.