mirror of
https://github.com/systemd/systemd.git
synced 2025-02-04 21:47:31 +03:00
Lennart Poettering
550c8784c5
udev: when random MACs are requested, generate them with genuine randomness
This is a security feature, and we thus shouldn't derive the random MACs from a potentially guessable source. MAC addresses are after all facing to the outside, and can be interacted with from untrusted environments. Hence, let's generate them the same way as we generate UUIDs: from getrandom() or /dev/urandom, and optionally with RDRAND if that's supported. RDRAND should be fine, since this is not cryptographic key material, but ultimately public information. We just want to make sure conflicts are not likely. Previously we'd generate the MACs via rand(), which means given the short seed they are a little bit too guessable, making collisions too likely. See #14355 in particular. Fixes: #14355 (Note that #14355 was already fixed by a0f11d1d11a546f791855ec9c47c2ff830e6a5aa, but I think we should do better even, and not rely on rand() and uninitialized random pools)
System and Service Manager
Details
General information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Stable branches with backported patches are available in the stable repo.
Languages
C
89.2%
Python
5.3%
Shell
4.1%
Meson
1.2%