Bug 2502239 (CVE-2026-53399) - CVE-2026-53399 kernel: nfsd: release layout stid on setlease failure
Summary: CVE-2026-53399 kernel: nfsd: release layout stid on setlease failure
Keywords:
Status: NEW
Alias: CVE-2026-53399
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-07-19 13:03 UTC by OSIDB Bzimport
Modified: 2026-09-23 05:56 UTC (History)
2 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2026:61887 0 None None None 2026-09-01 07:30:32 UTC
Red Hat Product Errata RHSA-2026:63013 0 None None None 2026-09-03 04:02:19 UTC
Red Hat Product Errata RHSA-2026:63014 0 None None None 2026-09-03 04:16:30 UTC
Red Hat Product Errata RHSA-2026:63129 0 None None None 2026-09-04 00:52:57 UTC

Description OSIDB Bzimport 2026-07-19 13:03:28 UTC
In the Linux kernel, the following vulnerability has been resolved:

nfsd: release layout stid on setlease failure

nfs4_alloc_stid() publishes the new stid into cl->cl_stateids via
idr_alloc_cyclic() under cl_lock before returning to
nfsd4_alloc_layout_stateid(). When nfsd4_layout_setlease() then
fails, the error path frees the layout stateid directly with
kmem_cache_free() without ever calling idr_remove(), leaving the
IDR slot pointing at freed slab memory. Any subsequent IDR walker
(states_show, client teardown) dereferences the dangling pointer.

The correct teardown for an IDR-published stid is nfs4_put_stid(),
which removes the IDR slot under cl_lock, dispatches sc_free
(nfsd4_free_layout_stateid) to release ls->ls_file via
nfsd4_close_layout(), and drops the nfs4_file reference in its
tail.

A second issue blocks that switch: nfsd4_free_layout_stateid()
unconditionally inspects ls->ls_fence_work via
delayed_work_pending() under ls_lock, but
INIT_DELAYED_WORK(&ls->ls_fence_work, ...) currently runs only
after the setlease call. On the setlease-failure path the
destructor would touch an uninitialized delayed_work.

    nfsd4_alloc_layout_stateid()
      nfs4_alloc_stid()           /* idr_alloc_cyclic under cl_lock */
      nfsd4_layout_setlease()     /* fails */
        nfs4_put_stid()
          nfsd4_free_layout_stateid()
            delayed_work_pending(&ls->ls_fence_work)  /* needs INIT */
            nfsd4_close_layout()  /* nfsd_file_put(ls->ls_file) */
          put_nfs4_file()

Fix by hoisting the ls_fenced / ls_fence_delay / INIT_DELAYED_WORK
initialization above the nfsd4_layout_setlease() call, and replace
the manual nfsd_file_put + put_nfs4_file + kmem_cache_free cleanup
with a single nfs4_put_stid(stp).

Comment 4 errata-xmlrpc 2026-09-01 07:30:31 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 10

Via RHSA-2026:61887 https://access.redhat.com/errata/RHSA-2026:61887

Comment 5 errata-xmlrpc 2026-09-03 04:02:18 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2026:63013 https://access.redhat.com/errata/RHSA-2026:63013

Comment 6 errata-xmlrpc 2026-09-03 04:16:29 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2026:63014 https://access.redhat.com/errata/RHSA-2026:63014

Comment 7 errata-xmlrpc 2026-09-04 00:52:56 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2026:63129 https://access.redhat.com/errata/RHSA-2026:63129


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