Skip to content

[Backport v4.4-branch] net: Fix generation of IPv6 IID and TCP ISN secret keys - #116533

Open
github-actions[bot] wants to merge 3 commits into
v4.4-branchfrom
backport-115807-to-v4.4-branch
Open

[Backport v4.4-branch] net: Fix generation of IPv6 IID and TCP ISN secret keys#116533
github-actions[bot] wants to merge 3 commits into
v4.4-branchfrom
backport-115807-to-v4.4-branch

Conversation

@github-actions

Copy link
Copy Markdown

Backport 700888e~3..700888e from #115807.

Original PR description:


  • Generate the RFC 7217 stable IID and RFC 8981 privacy extension secret keys
    with sys_csrand_get() instead of sys_rand_get(), and fail IID generation
    rather than deriving addresses from a predictable key.
  • Skip address configuration in the net_ipv6_addr_generate_iid() callers that
    only warned on failure and went on to install :: or uninitialized stack memory.
  • Check the result of the RFC 6528 TCP ISN key generation, which previously left
    the key zeroed on failure, and generate it once from a single guarded helper
    instead of two independent flags sharing one key.

Fixes: #116527

rlubos added 3 commits August 17, 2026 20:30
The secret key used to derive RFC 7217 stable and RFC 8981 temporary
interface identifiers is a long-lived protocol secret, so generate it
with sys_csrand_get() instead of the non-cryptographic sys_rand_get().
Fail the IID generation if no cryptographic randomness is available
rather than silently deriving addresses from a predictable key.

Assisted-by: Cursor:claude-opus-5
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 2533158)
Callers of net_ipv6_addr_generate_iid() only logged a warning and
carried on, so a failed generation left the configured SLAAC address as
:: or, in the ipip case, as uninitialized stack memory. Skip the address
configuration entirely when the IID cannot be generated.

Assisted-by: Cursor:claude-opus-5
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit f8b05ed)
An ignored sys_csrand_get() failure left the RFC 6528 secret key zeroed
for the rest of the boot, making the ISN computable from the four-tuple
alone. Generate the key from a single guarded helper that only latches
on success, and fall back to sys_rand32_get() when no cryptographic
randomness is available, as already happens when
CONFIG_NET_TCP_ISN_RFC6528 is disabled.

Assisted-by: Cursor:claude-opus-5
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 700888e)
@github-actions github-actions Bot added the Backport Backport PR and backport failure issues label Aug 17, 2026
@github-project-automation github-project-automation Bot moved this to To do in Backports Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport Backport PR and backport failure issues

Projects

Status: To do

Development

Successfully merging this pull request may close these issues.

1 participant