All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] ipv6: Use dev_addr in stable-privacy address generation
@ 2020-03-26  9:42 Bram Bonné
  2020-03-26 18:45 ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Bram Bonné @ 2020-03-26  9:42 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
	Jakub Kicinski, Hannes Frederic Sowa
  Cc: netdev, Bram Bonné, Lorenzo Colitti, Jeffrey Vanderstoep

This patch extends the IN6_ADDR_GEN_MODE_STABLE_PRIVACY address
generation mode to use the software-defined MAC address (dev_addr)
rather than the permanent, hardware-defined MAC address (perm_addr) of
the interface when generating IPv6 link-local addresses.

This ensures that the IPv6 link-local address changes in line with the
MAC address when per-network MAC address randomization is used,
providing the expected privacy guarantees.

When no MAC address randomization is used, dev_addr corresponds to
perm_addr, and IN6_ADDR_GEN_MODE_STABLE_PRIVACY behaves as before.

When MAC address randomization is used, this makes the MAC address
fulfill the role of both the Net_Iface and the (optional) Network_ID
parameters in RFC7217.

Cc: Lorenzo Colitti <lorenzo@google.com>
Cc: Jeffrey Vanderstoep <jeffv@google.com>
Signed-off-by: Bram Bonné <brambonne@google.com>
---
 net/ipv6/addrconf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 5b9de773ce73..cd69a4331246 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3252,7 +3252,7 @@ static int ipv6_generate_stable_address(struct in6_addr *address,
 	sha_init(digest);
 	memset(&data, 0, sizeof(data));
 	memset(workspace, 0, sizeof(workspace));
-	memcpy(data.hwaddr, idev->dev->perm_addr, idev->dev->addr_len);
+	memcpy(data.hwaddr, idev->dev->dev_addr, idev->dev->addr_len);
 	data.prefix[0] = address->s6_addr32[0];
 	data.prefix[1] = address->s6_addr32[1];
 	data.secret = secret;
-- 
2.25.1.696.g5e7596f4ac-goog


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-04-03 14:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26  9:42 [RFC PATCH] ipv6: Use dev_addr in stable-privacy address generation Bram Bonné
2020-03-26 18:45 ` David Miller
2020-03-27 11:50   ` Bram Bonné
2020-03-27 13:06     ` Hannes Frederic Sowa
2020-03-27 17:15       ` Bram Bonné
2020-03-27 20:51         ` Hannes Frederic Sowa
2020-04-03 14:40           ` Bram Bonné
2020-03-27 22:46     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.