[RFC PATCH] fix MAC address spoofing issues

Dan Williams dcbw
Tue Nov 23 18:48:15 PST 2010

On Sat, 2010-11-20 at 01:49 +0200, Jouni Malinen wrote:
> On Fri, Nov 19, 2010 at 03:52:22PM -0600, Dan Williams wrote:
> > This patch is from Jirka Klimes, developed to fix various issues when
> > spoofing MAC addresses.  Does this approach look workable?  If you have
> > specific questions about the issues he encountered I'm sure he could
> > elaborate.  But part of the problem was that if the MAC address gets
> > changed without removing and re-adding the interface to the supplicant,
> > it gets some upper-layer stuff wrong.  But removing and re-adding is a
> > pretty heavy operation that we don't want to do often.  In a more
> > dynamic environment you may want to spoof a MAC on one wifi network but
> > not on another, and in that case a managed like NM just switches the MAC
> > address of the interface (while the interface is in the disconnected
> > state) and then tells the supplicant to connect.
> What makes association so special? Shouldn't this update be done when
> the MAC address is changed or when the interface goes up and not when
> the next association request may be triggered? There is already a driver
> event (EVENT_INTERFACE_ENABLED) which will be indicated when the
> interface comes back up. Wouldn't that be able to provide an indication
> of the changed MAC address, too?
> Are you really changing the address so frequently, that removing and
> re-adding the interface would bring in noticeable problems? Is this for
> privacy purposes or what is the need for these MAC address changes?

MAC spoofing.  You may want to use a different MAC address at every
location of different network you connect to, which means potentially
changing the MAC address between associations.  What NetworkManager
currently does is to switch back to the permanent MAC address when
disconnected, and if connecting a configuration that requests MAC
spoofing it switches the MAC address before sending the network block to
the supplicant and calling SelectNetwork.  I'm not sure what's really
wrong with this approach; you don't want the spoofed MAC to be set
unless you're connected to the network for which the spoofed MAC is to
be used, and you may have more than one different MAC for the card.

That said, if there's another mechanism like enable/disable we could use
that, and NM could call some D-Bus method to enable/disable the
interface or something.  Or I guess we could remove/re-add, though that
seems somewhat heavy.


More information about the Hostap mailing list