{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "5e317d23f6c6c4b59d84e228a2271228e81cc797"
            },
            {
              "fixed": "fcece836e3ff8e100db9f11bede3564422ca89df"
            },
            {
              "fixed": "86a1ac57fa7fc93c229fe060dd42947631f9c82c"
            },
            {
              "fixed": "20a6a9ec19e522ae85f87337886b3fb47efce5f3"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "6.17.0"
            },
            {
              "fixed": "6.18.66"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.19.0"
            },
            {
              "fixed": "7.3.7"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143111.json"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\ndcache: let d_invalidate() wait for a d_set_mounted() in flight\n\nd_invalidate() and d_set_mounted() are supposed to exclude each other.\nEither the mount fails with -ENOENT because an ancestor of the\nmountpoint was unhashed or d_invalidate() finds the mountpoint and\ndetaches the mount. d_invalidate() unhashes the dentry first and then\nsearches the subtree with d_walk() which starts out lockless and only\nlooks at the seqcount of rename_lock.\n\nSince d_set_mounted() switched to read_seqlock_excl() nothing makes that\nwalk wait or retry:\n\n  CPU0: mount on A/M                 CPU1: d_invalidate(A)\n  d_set_mounted(M)\n    read_seqlock_excl(\u0026rename_lock)\n    A is hashed, go on\n                                     __d_drop(A)\n                                     shrink_dcache_parent(A)\n                                     d_walk(A, find_submount)\n                                       read_seqbegin(\u0026rename_lock)\n                                       M is not a mountpoint\n                                       need_seqretry() == false\n                                     return\n    M-\u003ed_flags |= DCACHE_MOUNTED\n    return 0\n  mount gets attached to M\n\nThe mount ends up below an unhashed dentry. It can't be reached anymore\nand pins the subtree until its parent mount or the mount namespace goes\naway. The window grows with the depth of the mountpoint. With a FUSE\ndirectory 3000 levels deep a bind mount racing with\nFUSE_NOTIFY_INVAL_ENTRY for the parent of the mountpoint survived in 151\nof 200 attempts.\n\nBefore 5e317d23f6c6 the seqcount bump made the walk wait while\nd_set_mounted() ran and retry under the lock when one had run in the\nmeantime. That was the right thing to wait for on the wrong counter:\nevery rename_lock reader paid for it, d_lookup(), d_path(), the \"..\"\nstep of the RCU walk.\n\nSo give d_set_mounted() a seqlock of its own. It is the only writer and\nd_invalidate() is the only reader. After unhashing the dentry\nd_invalidate() runs an empty read_seqbegin()/read_seqretry() section on\nit. That spins while the count is odd, i.e. while a d_set_mounted() is\nbetween its ancestor check and its flag, and goes round once more if\none started in the meantime. Nobody else retries anything. The ordering\ncomes from the locks both already take:\n\n- If that d_set_mounted() saw the dentry hashed its check ran under the\n  dentry's d_lock before __d_drop() took it. So the count is odd by the\n  time d_invalidate() reads it and d_invalidate() waits.\n\n- Once the count is even again the flag has been set under the\n  mountpoint's d_lock and the walk takes that lock to look at it.\n\nA d_set_mounted() that starts after the unhash fails its ancestor check\nand never touches the flag. So the only flag the walk can pick up\nbelongs to the one mount that saw the dentry hashed and is still in\nflight, and there is at most one of those because namespace_sem\nserializes mounts. Either it gets attached and detach_mounts() takes it\noff after waiting for namespace_sem or it fails later on and drops the\nflag again. In that case the walk goes round once more and finds\nnothing. The same goes for the mountpoint that attach_recursive_mnt()\npreallocates on the root of the tree it attaches. IOW, d_invalidate()\ndoes at most one extra round, which the removed-name trap (cf. [1])\nrelies on.\n\nNote that on PREEMPT_RT read_seqbegin() takes the lock instead of\nspinning on a preempted d_set_mounted().\n\nThe cost is a seqlock around the ancestor walk for every new mountpoint\nand two loads of a cacheline that only d_set_mounted() writes for every\nd_invalidate() of a positive dentry. Walking the ancestors a second time\nafter setting the flag would close the race as well but doubles the\ncost of d_set_mounted() with the depth of the mountpoint: about 1us at\n64 levels and 75us at 4096 levels.\n\n[1]: https://patch.msgid.link/20261028-work-mount-trap-b4-v1-0-f20d9d0730d6@kernel.org",
  "id": "CVE-2026-143111",
  "modified": "2026-12-03T10:45:21.000290698Z",
  "published": "2026-12-03T09:19:26.365Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/20a6a9ec19e522ae85f87337886b3fb47efce5f3"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/86a1ac57fa7fc93c229fe060dd42947631f9c82c"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/fcece836e3ff8e100db9f11bede3564422ca89df"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143111.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-143111"
    }
  ],
  "schema_version": "1.9.2",
  "summary": "dcache: let d_invalidate() wait for a d_set_mounted() in flight"
}