{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2026-99448",
  "modified": "2026-11-24T05:30:02Z",
  "upstream": [
    "CVE-2026-99448"
  ],
  "published": "2026-11-19T15:08:37Z",
  "summary": "ufs: use u64 for directory size in ufs_last_byte",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nufs: use u64 for directory size in ufs_last_byte\n\nufs1_read_inode() and ufs2_read_inode() copy the untrusted 64-bit\non-disk size into inode->i_size.  ufs_last_byte() then truncates that\nvalue to an unsigned int before calculating the valid extent of a\ndirectory folio.\n\nA directory size of exactly 4 GiB is truncated to zero.  In\nufs_find_entry(), subtracting the requested record length from that zero\nforms an endpoint almost 4 GiB beyond the mapped folio.  A crafted UFS2\nimage produces:\n\n  BUG: KASAN: use-after-free in ufs_find_entry+0x583/0x6e0 [ufs]\n  Read of size 1\n  ...\n  ufs_find_entry\n  ufs_inode_by_name\n  ufs_lookup\n  __lookup_slow\n  path_lookupat\n\nThe KASAN classification reflects that the adjacent physical page was\nfree; the source-level operation is an out-of-folio read.  A controlled\nUFS1 test with CONFIG_UFS_FS_WRITE enabled also made ufs_find_entry()\nreturn a directory entry from an adjacent anonymous page.  unlink() then\npassed that pointer to ufs_delete_entry(), which cleared the adjacent\npage's 3\n2-bit d_ino.  This write result reproduced three out of three\ntimes.\n\nUFS normally requires a privileged mount path.  A relevant boundary is\na privileged automounter or image-processing service handling an\nattacker-supplied filesystem.  The write primitive additionally requires\nUFS1 to be mounted read-write with CONFIG_UFS_FS_WRITE enabled; the read\nis reachable with read-only UFS2.\n\nKeep the intermediate size arithmetic at 64 bits so non-final pages are\nbounded at PAGE_SIZE.  With this change, the same controlled tests reach\nthe real on-disk directory entry and produce no adjacent-page write or\nKASAN report.  A reproducer and full validation logs are available on\nrequest.\n\nThe vulnerable helper is present in v7.2-rc3, v7.1, v6.18.38, v6.12.95,\nv6.6.111, and upstream master at 1229e2e57a5c.  Runtime reproduction and\nfix validation were performed in an x86-64 QEMU guest running v7.2-rc3\nwith generic KASAN.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.193",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2026-99448"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/c43f74f9a7418790f4e28bb94c1423be3ed6b22d"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/119344a21852412d867c499457b4111a0fb967f1"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/36b76a83cd622dfd52878c67437d6c3f55c44667"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/627b432794b1114ab2934f6ae6199d789842cb37"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ae50223c56b9a1c27d4f824c9e2fbbefc8686891"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/c792858491ee39e8f6e1547c45422595cf25b415"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ac2859c61ecf52a9e39b44b35c981dbfeb8ad54b"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/1eff23433e73d7da4f9e3529d2701e34962b161f"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-11-23T08:12:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The on-disk directory ui_size is copied into inode->i_size by ufs1_read_inode() or ufs2_read_inode() from the inode block read with sb_bread(). ufs_last_byte() is reached from path_lookupat() through ufs_lookup(), ufs_inode_by_name() and ufs_find_entry(), or from getdents() through ufs_readdir().\nAC:L - A directory ui_size of 4294967296 makes ufs_last_byte() truncate inode->i_size to unsigned 0 on page 0, and ufs_find_entry() adds the unsigned wrap of 0 minus UFS_DIR_REC_LEN(namelen) to the folio address. The image supplies that ui_size and a check-passing directory block, so the first lookup takes this path.\nPR:N - The party who supplies the image has no host credentials. ufs_fs_type.fs_flags is FS_REQUIRES_DEV, so mount_capable() requires capable(CAP_SYS_ADMIN) of the mounting process; ufs_lookup() then only applies may_lookup() to the ui_mode loaded by ufs1_read_inode().\nUI:R - ufs_fill_super() reaches ufs_iget(UFS_ROOTINO) and d_make_root(). The ufs_last_byte() underflow runs when a person mounts the crafted image and looks up a name or calls getdents on that directory.\nS:U - The folio overrun in ufs_find_entry() and the dir->d_ino store in ufs_delete_entry() both affect memory of the same kernel that mounted the volume.\nC:H - After the unsigned wrap, the ufs_find_entry() and ufs_readdir() end pointer lies almost 4GiB past the address from ufs_get_folio(). The loops parse the next physical page as ufs_dir_entry records, and ufs_readdir() passes de->d_name and ufs_get_de_namlen() to dir_emit() when d_ino is nonzero.\nI:H - ufs_unlink() passes the ufs_find_entry() pointer to ufs_delete_entry(), which stores 0 to dir->d_ino. With a 4GiB directory that pointer addresses the next physical page; the reported UFS1 run with CONFIG_UFS_FS_WRITE cleared that adjacent 32-bit d_ino on three of three tries.\nA:H - The read is the KASAN use-after-free in ufs_find_entry() reached from path_lookupat(). If the following dirent's d_reclen is 0, ufs_next_entry() returns the same pointer and the ufs_find_entry() loop does not reach its endpoint."
    }
  }
}
