{"id":"CVE-2022-50241","aliases":["CVE-2022-50241"],"related":[],"kind":"vulnerability","state":"published","title":"NFSD: fix use-after-free on source server when doing inter-server copy","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"}],"published":"2025-09-15T14:01:47.539Z","modified":"2026-10-15T22:17:28.173Z","severity":{"scorer":"Linux","scheme":"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,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"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,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"624322f1adc58acd0b69f77a6ddc764207e97241","fixed":"bbacfcde5fff25ac22597e8373a065c647da6738","status":"affected"},{"type":"git","introduced":"624322f1adc58acd0b69f77a6ddc764207e97241","fixed":"83b94969751a691347606dbe6b1865efcfa5a643","status":"affected"},{"type":"git","introduced":"624322f1adc58acd0b69f77a6ddc764207e97241","fixed":"6ea71246b7a02af675d733e72d14bd0d591d5f4a","status":"affected"},{"type":"git","introduced":"624322f1adc58acd0b69f77a6ddc764207e97241","fixed":"35aa0fb8c3033a3d78603356e96fc18c5b9cceb2","status":"affected"},{"type":"git","introduced":"624322f1adc58acd0b69f77a6ddc764207e97241","fixed":"019805fea91599b22dfa62ffb29c022f35abeb06","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.6","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.6","status":"unaffected"},{"type":"semver","introduced":"5.10.150","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.75","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"5.19.17","lastAffected":"5.19.*","status":"unaffected"},{"type":"semver","introduced":"6.0.3","lastAffected":"6.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","fixed":"5.10.150"},{"status":"affected","introduced":"5.11","fixed":"5.15.75"},{"status":"affected","introduced":"5.16","fixed":"5.19.17"},{"status":"affected","introduced":"6.0","fixed":"6.0.3"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/bbacfcde5fff25ac22597e8373a065c647da6738","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/83b94969751a691347606dbe6b1865efcfa5a643","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6ea71246b7a02af675d733e72d14bd0d591d5f4a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/35aa0fb8c3033a3d78603356e96fc18c5b9cceb2","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/019805fea91599b22dfa62ffb29c022f35abeb06","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-15T21:30:36.338Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-50241","url":"https://www.cve.org/CVERecord?id=CVE-2022-50241","licence":"CVE Terms of Use","modified":"2026-10-15T21:31:19.268Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-50241","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50241","licence":"Public domain","modified":"2026-10-15T22:17:28.173Z"}],"updatedAt":"2026-11-25T22:58:21.124Z","epss":{"score":0.00385,"percentile":0.34692,"date":"2026-12-01T12:00:22.000Z"}}