CVE-2026-80527: ceph: fix hanging __ceph_get_caps() with stale mds_wanted

Published Aug 26, 2026
·
Updated

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

ceph: fix hanging cephgetcaps() with stale mdswanted

A reader can hang forever in cephgetcaps() when the client no longer holds FILERD, but local cap state still says that the capability is already wanted (via mdswanted).

One way to trigger this is through MDS cap revocation. If another client performs a conflicting operation, the MDS can revoke FILERD from the reader; the next read then has to reacquire FILERD. If the cap update that should request FILERD never reaches the MDS after cap->mdswanted was raised, the reader is left holding only non-file caps while local mdswanted still includes the file read caps.

In that state, trygetcaprefs() sees need <= mdswanted and returns 0, so cephgetcaps() just waits on icapwq. If the cap update that was supposed to request FILERD never reaches the MDS after cap->mdswanted was raised, no further request is sent and the waiter can sleep indefinitely until unrelated cap traffic happens to wake it up.

The ordering issue is that cap->mdswanted is updated in prepcap() before the CEPHMSGCLIENTCAPS message is actually queued for send. That makes one field serve two different meanings at once: what this client wants, and what the client believes the MDS already knows it wants.

A proper fix would be to split those states and track whether a cap update is actually in flight or has been observed by the MDS. However, simply moving the cap->mdswanted assignment later would not be sufficient: queueing the message in the messenger does not guarantee that the MDS processed that specific wanted set, and reconnect or message loss can still invalidate that assumption. Fixing that properly would require a larger rework of the cap state machine.

To allow simpler backports to stable kernels, this patch implements a simpler workaround:

- stop waiting forever in cephgetcaps(); after a bounded wait, fall back to the renew path

- make cephrenewcaps() issue a synchronous OPEN request whenever the inode still does not actually hold the wanted caps, instead of only calling cephcheckcaps()

The extra issued-vs-wanted check in cephrenewcaps() is necessary because the previous test only checked whether the inode still had any real caps at all. That is not enough after revocation: the client can still hold something like pLs and yet be missing FILERD completely. In that case, falling back to cephcheckcaps() is not sufficient, because it still trusts cap->mdswanted and may resend nothing. By requiring (issued & wanted) == wanted before taking the asynchronous path, the code only uses cephcheckcaps() when the wanted caps are already actually issued. Otherwise, it sends the synchronous OPEN renew.

This preserves the existing asynchronous fast path when the wanted caps are already issued, avoids changing cap-state semantics, and fixes the hang by guaranteeing that a stalled waiter eventually retries through a path that does not rely on the stale mdswanted state.

[ idryomov: move CEPHGETCAPSWAITTIMEOUT from libceph.h to mdsclient.h, formatting ]

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Update ceph_renew_caps() to issue a synchronous `OPEN` request whenever required caps are not yet confirmed as issued (i.e., when `(issued & wanted) == wanted` is not satisfied), instead of relying on stale `mds_wanted` state that can leave the waiter sleeping.

    Ceph client (kernel) cap acquisition logic open/renew request behavior = issue a synchronous OPEN request whenever the client needs caps not yet confirmed as issued
  2. Configuration

    In __ceph_get_caps(), stop waiting forever after a bounded wait (CEPH_GET_CAPS_WAIT_TIMEOUT). Implement the timeout by moving CEPH_GET_CAPS_WAIT_TIMEOUT from libceph.h to __prep_cap() before the `CEPH_MSG_CLIENT_CAPS` message is sent.

    Ceph client (kernel) __ceph_get_caps bounded wait timeout = use CEPH_GET_CAPS_WAIT_TIMEOUT after moving it to __prep_cap()
  3. Configuration

    Fix the ordering issue by moving the `cap->mds_wanted` assignment later (after the needed condition is established), so that the async fast path (when wanted caps are already actually issued) is preserved while avoiding the stale `mds_wanted` scenario that causes hanging in __ceph_get_caps().

    Ceph client (kernel) cap->mds_wanted assignment ordering = assign cap->mds_wanted later

Event History

Aug 26, 2026
CVE Published
via MITRE·02:37 PM
Data Sourced
via MITRE·02:37 PM
Description
Data Sourced
via NVD·03:17 PM
Description

Frequently Asked Questions

1

Which systems are exposed to this hang?

Linux kernel Ceph clients performing reads can be affected when they lose the FILE_RD capability and must reacquire it. A conflicting operation by another client can trigger the relevant MDS capability revocation.

2

What must occur for the reader to remain blocked?

After local mds_wanted is raised to include the file-read capability, the corresponding client capability update must fail to reach the MDS. The client then retains only non-file capabilities while believing FILE_RD is already requested, so it does not send another request.

3

How does the issue present during triage?

A read can wait indefinitely in __ceph_get_caps() on i_cap_wq. The wait may end only if unrelated capability traffic happens to wake it, rather than because the missing FILE_RD request was retried.

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