All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bram Bonné" <brambonne@google.com>
To: "David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: netdev@vger.kernel.org, "Bram Bonné" <brambonne@google.com>,
	"Lorenzo Colitti" <lorenzo@google.com>,
	"Jeffrey Vanderstoep" <jeffv@google.com>
Subject: [RFC PATCH] ipv6: Use dev_addr in stable-privacy address generation
Date: Thu, 26 Mar 2020 10:42:52 +0100	[thread overview]
Message-ID: <20200326094252.157914-1-brambonne@google.com> (raw)

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


             reply	other threads:[~2020-03-26  9:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26  9:42 Bram Bonné [this message]
2020-03-26 18:45 ` [RFC PATCH] ipv6: Use dev_addr in stable-privacy address generation 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200326094252.157914-1-brambonne@google.com \
    --to=brambonne@google.com \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=jeffv@google.com \
    --cc=kuba@kernel.org \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=lorenzo@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.