Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2021-46989

HIGH 7.1EPSS 9%

hfsplus: prevent corruption in shrinking truncate

Mitigation

  • No fix listed yet: follow the vendor advisory.

Who should check

  • Anyone running Linux >= 31651c607151f1034cfb57e5a78678bea54c362b, < 52dde855663e5db824af51db39b5757d2ef3e28a; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c451a6bafb5f422197d31536f82116aed132b72c; >= 31651c607151f1034cfb57e5a78678bea54c362b, < adbd8a2a8cc05d9e501f93e5c95c59307874cc99; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c477f62db1a0c0ecaa60a29713006ceeeb04b685; >= 31651c607151f1034cfb57e5a78678bea54c362b, < 97314e45aa1223a42d60256a62c5d9af54baf446; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c3187cf32216313fb316084efac4dab3a8459b1d
  • Anyone running Linux 4.19

Vulnerability facts

Affected
Linux >= 31651c607151f1034cfb57e5a78678bea54c362b, < 52dde855663e5db824af51db39b5757d2ef3e28a; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c451a6bafb5f422197d31536f82116aed132b72c; >= 31651c607151f1034cfb57e5a78678bea54c362b, < adbd8a2a8cc05d9e501f93e5c95c59307874cc99; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c477f62db1a0c0ecaa60a29713006ceeeb04b685; >= 31651c607151f1034cfb57e5a78678bea54c362b, < 97314e45aa1223a42d60256a62c5d9af54baf446; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c3187cf32216313fb316084efac4dab3a8459b1d; Linux 4.19
Fixed in
Linux 52dde855663e5db824af51db39b5757d2ef3e28a, Linux 97314e45aa1223a42d60256a62c5d9af54baf446
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
7.1 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Local
  • Attack complexity: Low
  • Privileges required: Low
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: None
  • Integrity impact: High
  • Availability impact: High
EPSS
0.24% chance of exploitation in 30 days (percentile 9, 2026-11-26)
Published
Modified

Description

In the Linux kernel, the following vulnerability has been resolved: hfsplus: prevent corruption in shrinking truncate I believe there are some issues introduced by commit 31651c607151 ("hfsplus: avoid deadlock on file truncation") HFS+ has extent records which always contains 8 extents. In case the first extent record in catalog file gets full, new ones are allocated from extents overflow file. In case shrinking truncate happens to middle of an extent record which locates in extents overflow file, the logic in hfsplus_file_truncate() was changed so that call to hfs_brec_remove() is not guarded any more. Right action would be just freeing the extents that exceed the new size inside extent record by calling hfsplus_free_extents(), and then check if the whole extent record should be removed. However since the guard (blk_cnt > start) is now after the call to hfs_brec_remove(), this has unfortunate effect that the last matching extent record is removed unconditionally. To reproduce this issue, create a file which has at least 10 extents, and then perform shrinking truncate into middle of the last extent record, so that the number of remaining extents is not under or divisible by 8. This causes the last extent record (8 extents) to be removed totally instead of truncating into middle of it. Thus this causes corruption, and lost data. Fix for this is simply checking if the new truncated end is below the start of this extent record, making it safe to remove the full extent record. However call to hfs_brec_remove() can't be moved to it's previous place since we're dropping ->tree_lock and it can cause a race condition and the cached info being invalidated possibly corrupting the node data. Another issue is related to this one. When entering into the block (blk_cnt > start) we are not holding the ->tree_lock. We break out from the loop not holding the lock, but hfs_find_exit() does unlock it. Not sure if it's possible for someone else to take the lock under our feet, but it can cause hard to debug errors and premature unlocking. Even if there's no real risk of it, the locking should still always be kept in balance. Thus taking the lock now just before the check.

Affected and fixed versions

Package / productAffectedFixedSource
Linux>= 31651c607151f1034cfb57e5a78678bea54c362b, < 52dde855663e5db824af51db39b5757d2ef3e28a; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c451a6bafb5f422197d31536f82116aed132b72c; >= 31651c607151f1034cfb57e5a78678bea54c362b, < adbd8a2a8cc05d9e501f93e5c95c59307874cc99; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c477f62db1a0c0ecaa60a29713006ceeeb04b685; >= 31651c607151f1034cfb57e5a78678bea54c362b, < 97314e45aa1223a42d60256a62c5d9af54baf446; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c3187cf32216313fb316084efac4dab3a8459b1d—cvelist
Linux4.19—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2021-46989. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-46989.md
Affected: Linux >= 31651c607151f1034cfb57e5a78678bea54c362b, < 52dde855663e5db824af51db39b5757d2ef3e28a; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c451a6bafb5f422197d31536f82116aed132b72c; >= 31651c607151f1034cfb57e5a78678bea54c362b, < adbd8a2a8cc05d9e501f93e5c95c59307874cc99; >= 31651c607151f1034cfb57e…
Fixed in: Linux 52dde855663e5db824af51db39b5757d2ef3e28a, Linux 97314e45aa1223a42d60256a62c5d9af54baf446

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2021-46989 being exploited?

There is no confirmed exploitation: CVE-2021-46989 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.24% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2021-46989?

High: CVSS 7.1 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

Which versions are affected by CVE-2021-46989?

Linux >= 31651c607151f1034cfb57e5a78678bea54c362b, < 52dde855663e5db824af51db39b5757d2ef3e28a; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c451a6bafb5f422197d31536f82116aed132b72c; >= 31651c607151f1034cfb57e5a78678bea54c362b, < adbd8a2a8cc05d9e501f93e5c95c59307874cc99; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c477f62db1a0c0ecaa60a29713006ceeeb04b685; >= 31651c607151f1034cfb57e5a78678bea54c362b, < 97314e45aa1223a42d60256a62c5d9af54baf446; >= 31651c607151f1034cfb57e5a78678bea54c362b, < c3187cf32216313fb316084efac4dab3a8459b1d; Linux 4.19.

Is there a fix for CVE-2021-46989?

Yes. Fixed in Linux 52dde855663e5db824af51db39b5757d2ef3e28a, Linux 97314e45aa1223a42d60256a62c5d9af54baf446. No fix listed yet: follow the vendor advisory.

How do I check if I'm affected by CVE-2021-46989?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors