Bug 2338816 (CVE-2025-21640) - CVE-2025-21640 kernel: sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy
Summary: CVE-2025-21640 kernel: sctp: sysctl: cookie_hmac_alg: avoid using current->ns...
Keywords:
Status: NEW
Alias: CVE-2025-21640
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-01-19 11:01 UTC by OSIDB Bzimport
Modified: 2025-01-20 07:41 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-01-19 11:01:26 UTC
In the Linux kernel, the following vulnerability has been resolved:

sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy

As mentioned in a previous commit of this series, using the 'net'
structure via 'current' is not recommended for different reasons:

- Inconsistency: getting info from the reader's/writer's netns vs only
  from the opener's netns.

- current->nsproxy can be NULL in some cases, resulting in an 'Oops'
  (null-ptr-deref), e.g. when the current task is exiting, as spotted by
  syzbot [1] using acct(2).

The 'net' structure can be obtained from the table->data using
container_of().

Note that table->data could also be used directly, as this is the only
member needed from the 'net' structure, but that would increase the size
of this fix, to use '*data' everywhere 'net->sctp.sctp_hmac_alg' is
used.

Comment 1 Avinash Hanwate 2025-01-20 07:38:07 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025011944-CVE-2025-21640-4dd1@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.