{"id":"CVE-2024-41016","state":"PUBLISHED","title":"ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()\n\nxattr in ocfs2 maybe 'non-indexed', which saved with additional space\nrequested.  It's better to check if the memory is out of bound before\nmemcmp, although this possibility mainly comes from crafted poisonous\nimages.","publishedAt":"2024-07-29T06:37:02.530Z","updatedAt":"2026-10-15T00:47:16.242Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"e2b3d7a9d019d4d1a0da6c3ea64a1ff79c99c090","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"e8f9c4af7af7e9e4cd09c0251c7936593147419f","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"57a3d89831fcaa2cdbe024b47c7c36d5a56c3637","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"c031d286eceb82f72f8623b7f4abd2aa491bfb5e","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"cfb926051fab19b10d1e65976211f364aa820180","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"c726dea9d0c806d64c26fcef483b1fb9474d8c5e","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"e4ffea01adf3323c821b6f37e9577d2d400adbaa","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"af77c4fc1871847b528d58b7fdafb4aa1f6a9262","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ocfs2/xattr.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.28","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.28","versionType":"semver"},{"version":"4.19.323","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.285","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.227","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.168","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.112","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.53","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.10.12","status":"unaffected","lessThanOrEqual":"6.10.*","versionType":"semver"},{"version":"6.11","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ocfs2/xattr.c"]}],"references":["https://git.kernel.org/stable/c/e2b3d7a9d019d4d1a0da6c3ea64a1ff79c99c090","https://git.kernel.org/stable/c/e8f9c4af7af7e9e4cd09c0251c7936593147419f","https://git.kernel.org/stable/c/57a3d89831fcaa2cdbe024b47c7c36d5a56c3637","https://git.kernel.org/stable/c/c031d286eceb82f72f8623b7f4abd2aa491bfb5e","https://git.kernel.org/stable/c/cfb926051fab19b10d1e65976211f364aa820180","https://git.kernel.org/stable/c/c726dea9d0c806d64c26fcef483b1fb9474d8c5e","https://git.kernel.org/stable/c/e4ffea01adf3323c821b6f37e9577d2d400adbaa","https://git.kernel.org/stable/c/af77c4fc1871847b528d58b7fdafb4aa1f6a9262","https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html","https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html","https://cert-portal.siemens.com/productcert/html/ssa-265688.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:39.287Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/41xxx/CVE-2024-41016.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-41016","state":"PUBLISHED","datePublished":"2024-07-29T06:37:02.530Z","dateUpdated":"2026-10-15T00:47:16.242Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-07-12T12:17:45.612Z"},"containers":{"cna":{"title":"ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()\n\nxattr in ocfs2 maybe 'non-indexed', which saved with additional space\nrequested.  It's better to check if the memory is out of bound before\nmemcmp, although this possibility mainly comes from crafted poisonous\nimages."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"e2b3d7a9d019d4d1a0da6c3ea64a1ff79c99c090","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"e8f9c4af7af7e9e4cd09c0251c7936593147419f","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"57a3d89831fcaa2cdbe024b47c7c36d5a56c3637","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"c031d286eceb82f72f8623b7f4abd2aa491bfb5e","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"cfb926051fab19b10d1e65976211f364aa820180","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"c726dea9d0c806d64c26fcef483b1fb9474d8c5e","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"e4ffea01adf3323c821b6f37e9577d2d400adbaa","versionType":"git"},{"version":"cf1d6c763fbcb115263114302485ad17e7933d87","status":"affected","lessThan":"af77c4fc1871847b528d58b7fdafb4aa1f6a9262","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ocfs2/xattr.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.28","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.28","versionType":"semver"},{"version":"4.19.323","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.285","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.227","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.168","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.112","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.53","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.10.12","status":"unaffected","lessThanOrEqual":"6.10.*","versionType":"semver"},{"version":"6.11","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ocfs2/xattr.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/e2b3d7a9d019d4d1a0da6c3ea64a1ff79c99c090"},{"url":"https://git.kernel.org/stable/c/e8f9c4af7af7e9e4cd09c0251c7936593147419f"},{"url":"https://git.kernel.org/stable/c/57a3d89831fcaa2cdbe024b47c7c36d5a56c3637"},{"url":"https://git.kernel.org/stable/c/c031d286eceb82f72f8623b7f4abd2aa491bfb5e"},{"url":"https://git.kernel.org/stable/c/cfb926051fab19b10d1e65976211f364aa820180"},{"url":"https://git.kernel.org/stable/c/c726dea9d0c806d64c26fcef483b1fb9474d8c5e"},{"url":"https://git.kernel.org/stable/c/e4ffea01adf3323c821b6f37e9577d2d400adbaa"},{"url":"https://git.kernel.org/stable/c/af77c4fc1871847b528d58b7fdafb4aa1f6a9262"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - Reaching `ocfs2_xattr_find_entry()` requires a crafted OCFS2 image to be present locally (loop-mounted file or attached block device/USB stick) and then touched via `getxattr()`/`setxattr()` or an automatic security-label lookup; there is no remote protocol path into the ocfs2 xattr code.\nAC:L - The attacker authors the on-disk metadata, and `xe_name_offset` is an unvalidated `__le16`, so the read at `xs->base + name_offset` (up to 65535 bytes past a 512–4096 byte block buffer) fires deterministically on the first `getxattr()` with a matching type/name-length; no race, no memory-layout luck, and no non-default kernel config is involved, and for offsets inside the same page the \"out-of-bounds\" bytes are other blocks of the attacker's own image, making the `memcmp()` match reliably.\nPR:L - An unprivileged local user can supply the poisoned image (a file for loop-mount or removable media handled by udisks2/systemd automount) and then trigger the path with ordinary unprivileged `getxattr()`/`setxattr()` calls on the crafted file; no capability of the attacker's own is needed.\nUI:N - On the common desktop/kiosk/embedded deployment the attacker-supplied device is mounted automatically by the automount daemon, and the attacking process itself then issues the `getxattr()`/`setxattr()` that hits the unchecked `memcmp()` — no deliberate action by another user is required.\nS:U - The out-of-bounds read and the resulting out-of-bounds write stay inside the kernel's own memory and security authority; no VM, IOMMU, container, or sandbox boundary is crossed.\nC:H - Once the unchecked `memcmp()` matches out-of-bounds bytes, `ocfs2_xattr_ibody_get()`/`ocfs2_xattr_block_get()` `memcpy()` from `xs->base + xe_name_offset + name_len` for `xe_value_size` bytes (attacker-chosen, up to XATTR_SIZE_MAX) straight into the caller's userspace buffer, disclosing kernel memory beyond the buffer_head; the match/no-match result also forms a byte-granular oracle over ~64 KiB past the buffer.\nI:H - The same missing check on the setxattr path (`ocfs2_xattr_ibody_find()`/`ocfs2_xattr_block_find()`) lets a bogus `xe_name_offset` propagate into `ocfs2_xa_set()`, where `ocfs2_xa_reuse_entry()`/`ocfs2_xa_store_value()` `memset()`/`memcpy()` attacker-supplied value bytes at `base + name_offset`, and `ocfs2_xa_block_wipe_namevalue()` `memmove()`s with that offset — an out-of-bounds heap write with controlled content suitable for control-flow hijacking.\nA:H - The read (and the subsequent write/memmove) can land up to ~65790 bytes past a 512–4096 byte block buffer, readily touching unmapped or unrelated memory and producing a kernel oops/page fault (immediate KASAN slab-out-of-bounds), and corrupting neighbouring kernel data crashes the system; the trigger is repeatable on demand."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:34:42.104Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.28","versionEndExcluding":"4.19.323"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.28","versionEndExcluding":"5.4.285"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.28","versionEndExcluding":"5.10.227"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.28","versionEndExcluding":"5.15.168"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.28","versionEndExcluding":"6.1.112"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.28","versionEndExcluding":"6.6.53"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.28","versionEndExcluding":"6.10.12"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.28","versionEndExcluding":"6.11"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/af77c4fc1871847b528d58b7fdafb4aa1f6a9262","tags":["x_transferred"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T21:59:18.988Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-41016","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-09-10T16:24:43.120825Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-09-11T17:34:05.725Z"}},{"affected":[{"vendor":"Siemens","product":"SIMATIC S7-1500 TM MFP - GNU/Linux subsystem","defaultStatus":"unknown","versions":[{"version":"0","status":"affected","lessThan":"V1.1.1","versionType":"custom"}]}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html"}],"providerMetadata":{"shortName":"siemens-SADP","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","dateUpdated":"2026-10-15T00:47:16.242Z"},"x_adpType":"supplier"}]}}}