CVE-2022-50241: NFSD: fix use-after-free on source server when doing inter-server copy

Published Sep 15, 2025
·
Updated

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

NFSD: fix use-after-free on source server when doing inter-server copy

Use-after-free occurred when the laundromat tried to free expired cpntfstate entry on the s2scpstateids list after inter-server copy completed. The sccplist that the expired copy state was inserted on was already freed.

When COPY completes, the Linux client normally sends LOCKU(lockstate x), FREESTATEID(lockstate x) and CLOSE(openstate y) to the source server. The nfs4putstid call from nfsd4freestateid cleans up the copy state from the s2scpstateids list before freeing the lock state's stid.

However, sometimes the CLOSE was sent before the FREESTATEID request. When this happens, the nfsd4closeopenstateid call from nfsd4close frees all lock states on its stlocks list without cleaning up the copy state on the sccplist list. When the time the FREESTATEID arrives the server returns BADSTATEID since the lock state was freed. This causes the use-after-free error to occur when the laundromat tries to free the expired cpntfstate.

This patch adds a call to nfs4freecpntfstatelist in nfsd4closeopenstateid to clean up the copy state before calling freeolstateidreaplist to free the lock state's stid on the reaplist.

Affected Software

5 affected components
Linux Linux kernel
Linux Linux kernel<5.10.150
Linux Linux kernel>=5.11<5.15.75
Linux Linux kernel>=5.16<5.19.17
Linux Linux kernel>=6.0<6.0.3

Event History

Sep 15, 2025
CVE Published
via MITRE·02:01 PM
Data Sourced
via MITRE·02:01 PM
DescriptionSeverity
Data Sourced
via NVD·02:15 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-50241?

CVE-2022-50241 has been assigned a high severity rating due to the possibility of a use-after-free vulnerability in the Linux kernel.

2

How do I fix CVE-2022-50241?

To fix CVE-2022-50241, update your Linux kernel to the latest version that includes the patch addressing this vulnerability.

3

What is a use-after-free vulnerability in CVE-2022-50241?

A use-after-free vulnerability, like in CVE-2022-50241, occurs when a program continues to use memory after it has been freed, potentially leading to arbitrary code execution.

4

Which systems are affected by CVE-2022-50241?

CVE-2022-50241 affects systems running specific versions of the Linux kernel that are susceptible to the identified use-after-free issue.

5

Is there a known exploit for CVE-2022-50241?

As of now, there are no publicly known exploits for CVE-2022-50241, but the vulnerability should be addressed promptly.

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