After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770611 - "ethernet.cloned-mac-address" should default to "preserve"
"ethernet.cloned-mac-address" should default to "preserve"
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
1.4.x
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-08-30 20:11 UTC by Daniel Kahn Gillmor
Modified: 2016-09-12 12:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
device: change default value for cloned-mac-address to "preserve" (bgo#770611) (7.35 KB, patch)
2016-09-01 16:07 UTC, Thomas Haller
none Details | Review

Description Daniel Kahn Gillmor 2016-08-30 20:11:40 UTC
Over in #708820, there were several bugs that got fixed.  thanks for that!

But the discussion tailed off over the default setting of ethernet.cloned-mac-address.  It is currently "persistent", but it should really be (and used to be a couple versions ago) "preserve".

Please change the default back to "preserve" so that lower-level (earlier userspace) randomizations aren't overridden by default.

Users should not need to modify two different places on a system with both udev and nm in order to ensure that their hardware address is randomized as early as possible.

I've broken this out separately from #708820 so that it has its own distinct discussion.

Thanks for all your work on network-manager!
Comment 1 Thomas Haller 2016-08-30 20:40:37 UTC
The patch itself is trivial:
https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/devices/nm-device.c?id=ee6a4039c8c49d795051b75cc5e148d463ff561a#n11705


I tend to agree with this change of the default value. It indeed makes more sense, although it changes the behavior of the last two years. I suspect that few users actually rely on this behavior (because for a user who doesn't care and doesn't take special action, the MAC address is already the permanent one).




Of course, that default-value is already now configurable in NetworkManager.conf by having:

[device-mac-addr-preserve]
ethernet.cloned-mac-address=preserve
wifi.cloned-mac-address=preserve

in a file like /etc/NetworkManager/conf.d/20-mac-addr-preserve.conf.

-- distributions and packages should install such snippets in /usr/lib/NM/conf.d instead.





+1 this change.
Comment 2 Daniel Kahn Gillmor 2016-08-30 20:59:02 UTC
Thanks for the quick followup, Thomas.

I'm not sure which approach you're +1'ing -- the change on line 11705 of nm-device.c, or encouraging distros to ship /etc/NetworkManager/conf.d/20-mac-addr-preserve.conf by default?

It seems simplest to just change nm-device.c:11705 and let any distro that really wants "permanent" (not "persistent", as i wrote earlier, sorry) add their own separate nm config snippet.
Comment 3 Thomas Haller 2016-08-30 21:27:00 UTC
+1 for changing the upstream default-value of last resort in nm-device.c :)
Comment 4 Thomas Haller 2016-09-01 16:07:07 UTC
Created attachment 334608 [details] [review]
device: change default value for cloned-mac-address to "preserve" (bgo#770611)

Long ago before commit 1b49f94, NetworkManager did not touch the
MAC address at all. Since 0.8.2 NetworkManager would modify the
MAC address, and eventually it would reset the permanent MAC address
of the device.

This prevents a user from externally setting the MAC address via tools
like macchanger and rely on NetworkManager not to reset it to the
permanent MAC address. This is considered a security regression in
bgo#708820.

This only changed with commit 9a354cd and 1.4.0. Since then it is possible
to configure "cloned-mac-address=preserve", which instead uses the "initial"
MAC address when the device activates.
This also changed that the "initial" MAC address is the address that was
externally configured on the device as last. In other words, the
"initial" MAC address is picked up from external changes, unless it
was NetworkManager itself who configured the address when activating a
connection.

However, in absence of an explicit configuration the default for
"cloned-mac-address" is still "permanent". Meaning, the user has to
explicitly configure that NetworkManager should not touch the MAC address.
It makes sense to change the upstream default to "preserve". Although this
is a change in behavior since 0.8.2 it seems a better default.

This change has the drastic effect that all the existing connections
out there with "cloned-mac-address=$(nil)" change behavior after upgrade.
I think most users won't notice, because their devices have the permanent
address set by default anyway. I would think that there are few users
who intentionally configured "cloned-mac-address=" to have NetworkManager
restore the permanent address.
Comment 5 intrigeri 2016-09-01 22:15:45 UTC
With this change, the concern we raised by opening https://bugzilla.gnome.org/show_bug.cgi?id=708820 will be fully addressed :) Thanks a lot, Daniel and Thomas!
Comment 6 Thomas Haller 2016-09-12 12:05:14 UTC
merged to master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=fae5ecec5a4d9987a1915441602cb78275a9f490

Not merged to nm-1-4 branch, as we change the behavior with 1.6.0 and not on the next minor 1.4.x release.