netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [REGRESSION] net/ipv6/addrconf: Temporary addresses with short lifetimes generating when they shouldn't, causing applications to fail
@ 2023-12-21 23:10 Dan Moulding
  2023-12-22 23:42 ` Alex Henrie
  2023-12-23  8:42 ` Linux regression tracking #adding (Thorsten Leemhuis)
  0 siblings, 2 replies; 12+ messages in thread
From: Dan Moulding @ 2023-12-21 23:10 UTC (permalink / raw)
  To: dan
  Cc: Alex Henrie, David S. Miller, David Ahern, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel

I started running v6.7-rc5 on a desktop and began having problems
where Chromium would frequently fail to load pages and give an
"ERR_NETWORK_CHANGED" message instead. I also noticed instability in
avahi-daemon (it would stop resolving local names and/or consume 100%
CPU). Eventually I discovered that what is happening is that new
temporary IPv6 addresses for a ULA address are being generated once
every second, with very short preferred lifetimes (and I had an
interface with thousands of such temporary addresses). I also found
that it seems to be triggered when one of the devices on the network
sends a router advertisement with a prefix that has a preferred
lifetime of 0 (presumably it's sending that because it wants to
deprecate that prefix).

I bisected it to commit 629df6701c8a ("net: ipv6/addrconf: clamp
preferred_lft to the minimum required"). Upon reviewing that change, I
see that it has changed when generation of temporary addresses will be
allowed. I believe that change might have inadvertently caused the
kernel to violate RFC 4941 and might need to be reverted.

In particular RFC 4941 specifies that the preferred lifetime of a
temporary address must not be greater than the preferred lifetime of
the public address it is derived from. However, this change allows a
temporary address to be generated with a preferred lifetime greater
than the public address' preferred lifetime.

From RFC 4941:

    4.  When creating a temporary address, the lifetime values MUST be
        derived from the corresponding prefix as follows:

        *  Its Valid Lifetime is the lower of the Valid Lifetime of the
           public address or TEMP_VALID_LIFETIME.

        *  Its Preferred Lifetime is the lower of the Preferred Lifetime
           of the public address or TEMP_PREFERRED_LIFETIME -
           DESYNC_FACTOR.

Previously temporary addresses would not be generated for an interface
if the administratively configured preferred lifetime on that
interface was too short. This change tries to avoid that, and allow
generating temporary addresses even on interfaces with very short
configured lifetimes, by simply increasing the preferred lifetime of
the generated address. However, doing so runs afoul of the above
requirement. It allows the preferred lifetime of the temporary address
to be increased to a value that is larger than the public address'
preferred lifetime. For example, in my case where the router
advertisement causes the public address' preferred lifetime to be set
to 0, the current code allows a temporary address to be generated with
a preferred lifetime of (regen_advance + age + 1), which is obviously
greater than 0. It also, in my case, leads to new temporary addresses
with very short lifetimes being generated, about once every second,
leading to the application-level issues I described above.

Cheers,

-- Dan

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

end of thread, other threads:[~2024-01-02 23:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-21 23:10 [REGRESSION] net/ipv6/addrconf: Temporary addresses with short lifetimes generating when they shouldn't, causing applications to fail Dan Moulding
2023-12-22 23:42 ` Alex Henrie
2023-12-22 23:42   ` [PATCH net] net: ipv6/addrconf: clamp temporary address's preferred lifetime to public address's Alex Henrie
2023-12-23 15:22   ` [REGRESSION] net/ipv6/addrconf: Temporary addresses with short lifetimes generating when they shouldn't, causing applications to fail Dan Moulding
2023-12-24  0:07     ` Alex Henrie
2023-12-29 16:33       ` Dan Moulding
2023-12-29 22:52         ` David Ahern
2023-12-30  4:32           ` [PATCH] Revert "net: ipv6/addrconf: clamp preferred_lft to the minimum required" Alex Henrie
2023-12-30 15:43             ` David Ahern
2024-01-02 23:10             ` patchwork-bot+netdevbpf
2023-12-30  4:12         ` [REGRESSION] net/ipv6/addrconf: Temporary addresses with short lifetimes generating when they shouldn't, causing applications to fail Alex Henrie
2023-12-23  8:42 ` Linux regression tracking #adding (Thorsten Leemhuis)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).