{"id":"CVE-2022-50241","revision":"c9ee3954c2094be7819dff44c9640bbb","records":[{"revision":"c9ee3954c2094be7819dff44c9640bbb","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2022-50241","aliases":[],"title":"NFSD: fix use-after-free on source server when doing inter-server copy","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nNFSD: fix use-after-free on source server when doing inter-server copy\n\nUse-after-free occurred when the laundromat tried to free expired\ncpntf_state entry on the s2s_cp_stateids list after inter-server\ncopy completed. The sc_cp_list that the expired copy state was\ninserted on was already freed.\n\nWhen COPY completes, the Linux client normally sends LOCKU(lock_state x),\nFREE_STATEID(lock_state x) and CLOSE(open_state y) to the source server.\nThe nfs4_put_stid call from nfsd4_free_stateid cleans up the copy state\nfrom the s2s_cp_stateids list before freeing the lock state's stid.\n\nHowever, sometimes the CLOSE was sent before the FREE_STATEID request.\nWhen this happens, the nfsd4_close_open_stateid call from nfsd4_close\nfrees all lock states on its st_locks list without cleaning up the copy\nstate on the sc_cp_list list. When the time the FREE_STATEID arrives the\nserver returns BAD_STATEID since the lock state was freed. This causes\nthe use-after-free error to occur when the laundromat tries to free\nthe expired cpntf_state.\n\nThis patch adds a call to nfs4_free_cpntf_statelist in\nnfsd4_close_open_stateid to clean up the copy state before calling\nfree_ol_stateid_reaplist to free the lock state's stid on the reaplist.","state":0,"publishedAt":"2025-09-15T14:01:47.539+00:00","modifiedAt":"2026-10-15T21:31:19.268+00:00","affected":[{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"unaffected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"fs/nfsd/nfs4state.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"624322f1adc58acd0b69f77a6ddc764207e97241\",\n                            \"lessThan\": \"bbacfcde5fff25ac22597e8373a065c647da6738\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"624322f1adc58acd0b69f77a6ddc764207e97241\",\n                            \"lessThan\": \"83b94969751a691347606dbe6b1865efcfa5a643\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"624322f1adc58acd0b69f77a6ddc764207e97241\",\n                            \"lessThan\": \"6ea71246b7a02af675d733e72d14bd0d591d5f4a\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"624322f1adc58acd0b69f77a6ddc764207e97241\",\n                            \"lessThan\": \"35aa0fb8c3033a3d78603356e96fc18c5b9cceb2\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"624322f1adc58acd0b69f77a6ddc764207e97241\",\n                            \"lessThan\": \"019805fea91599b22dfa62ffb29c022f35abeb06\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"affected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"fs/nfsd/nfs4state.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"5.6\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \"0\",\n                            \"lessThan\": \"5.6\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"5.10.150\",\n                            \"lessThanOrEqual\": \"5.10.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"5.15.75\",\n                            \"lessThanOrEqual\": \"5.15.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"5.19.17\",\n                            \"lessThanOrEqual\": \"5.19.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.0.3\",\n                            \"lessThanOrEqual\": \"6.0.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.1\",\n                            \"lessThanOrEqual\": \"*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"original_commit_for_fix\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"severity":"HIGH"}],"references":["https://git.kernel.org/stable/c/bbacfcde5fff25ac22597e8373a065c647da6738","https://git.kernel.org/stable/c/83b94969751a691347606dbe6b1865efcfa5a643","https://git.kernel.org/stable/c/6ea71246b7a02af675d733e72d14bd0d591d5f4a","https://git.kernel.org/stable/c/35aa0fb8c3033a3d78603356e96fc18c5b9cceb2","https://git.kernel.org/stable/c/019805fea91599b22dfa62ffb29c022f35abeb06"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2022-50241","license":"CVE Program Terms of Use","key":"cve-program:CVE-2022-50241","identifiers":["CVE-2022-50241"]},"retained":false,"historicalAffected":[]}],"coverage":[]}