CVE-2026-31516: xfrm: prevent policy_hthresh.work from racing with netns teardown

Published Apr 22, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

xfrm: prevent policyhthresh.work from racing with netns teardown

A XFRMMSGNEWSPDINFO request can queue the per-net work item policyhthresh.work onto the system workqueue.

The queued callback, xfrmhashrebuild(), retrieves the enclosing struct net via containerof(). If the net namespace is torn down before that work runs, the associated struct net may already have been freed, and xfrmhashrebuild() may then dereference stale memory.

xfrmpolicyfini() already flushes policyhashwork during teardown, but it does not synchronize policyhthresh.work.

Synchronize policyhthresh.work in xfrmpolicyfini() as well, so the queued work cannot outlive the net namespace teardown and access a freed struct net.

Affected Software

12 affected components
Linux Linux kernel
Linux Linux kernel>=3.18.1<6.12.80
Linux Linux kernel>=6.13<6.18.21
Linux Linux kernel>=6.19<6.19.11
Linux Linux kernel=3.18
Linux Linux kernel=7.0-rc1
Linux Linux kernel=7.0-rc2
Linux Linux kernel=7.0-rc3
Linux Linux kernel=7.0-rc4
Linux Linux kernel=7.0-rc5
Linux Linux kernel=7.0-rc6
Linux Linux kernel=7.0-rc7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    In xfrm_policy_fini(), synchronize/flush policy_hthresh.work during net namespace teardown so the queued callback xfrm_hash_rebuild() cannot dereference stale memory after the associated struct net has been freed.

    Linux kernel xfrm_policy_fini() Synchronize policy_hthresh.work with net namespace teardown (flush before freeing) = Ensure policy_hthresh.work is synchronized/flushed in xfrm_policy_fini() (not just policy_hash_work)

Event History

Apr 22, 2026
CVE Published
via MITRE·01:54 PM
Data Sourced
via MITRE·01:54 PM
DescriptionSeverity
Data Sourced
via NVD·02:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Apr 23, 2026
Data Sourced
via Microsoft·08:04 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the severity of CVE-2026-31516?

CVE-2026-31516 has been classified with a severity level that may impact the stability of the Linux kernel.

2

How do I fix CVE-2026-31516?

To fix CVE-2026-31516, you should update to the latest patched version of the Linux kernel that addresses this vulnerability.

3

Who is affected by CVE-2026-31516?

CVE-2026-31516 affects users running vulnerable versions of the Linux kernel that utilize the XFRM subsystem.

4

What kind of attacks can CVE-2026-31516 help facilitate?

CVE-2026-31516 could be exploited to create race conditions that may lead to unexpected behavior during net namespace teardown.

5

When was CVE-2026-31516 reported?

CVE-2026-31516 was reported as part of ongoing security assessments of the Linux kernel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203