# CVE-2024-49869: btrfs: send: fix buffer overflow detection when copying path to cache entry

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-120
- **Published:** 2024-10-21T18:01:11.389Z
- **Modified:** 2026-06-17T08:00:37.350Z

## Who should check

- Anyone running Linux \>= c0247d289e73e18f6ddb0895de30c09770fbed95, \< 843738ede6cb8b959fb22591fcbabe8b456d7216; \>= c0247d289e73e18f6ddb0895de30c09770fbed95, \< 96c6ca71572a3556ed0c37237305657ff47174b7
- Anyone running Linux 6.11

## Description

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

btrfs: send: fix buffer overflow detection when copying path to cache entry

Starting with commit c0247d289e73 ("btrfs: send: annotate struct
name\_cache\_entry with \_\_counted\_by()") we annotated the variable length
array "name" from the name\_cache\_entry structure with \_\_counted\_by() to
improve overflow detection. However that alone was not correct, because
the length of that array does not match the "name\_len" field - it matches
that plus 1 to include the NUL string terminator, so that makes a
fortified kernel think there's an overflow and report a splat like this:

  strcpy: detected buffer overflow: 20 byte write of buffer size 19
  WARNING: CPU: 3 PID: 3310 at \_\_fortify\_report+0x45/0x50
  CPU: 3 UID: 0 PID: 3310 Comm: btrfs Not tainted 6.11.0-prnet \#1
  Hardware name: CompuLab Ltd.  sbc-ihsw/Intense-PC2 (IPC2), BIOS IPC2\_3.330.7 X64 03/15/2018
  RIP: 0010:\_\_fortify\_report+0x45/0x50
  Code: 48 8b 34 (...)
  RSP: 0018:ffff97ebc0d6f650 EFLAGS: 00010246
  RAX: 7749924ef60fa600 RBX: ffff8bf5446a521a RCX: 0000000000000027
  RDX: 00000000ffffdfff RSI: ffff97ebc0d6f548 RDI: ffff8bf84e7a1cc8
  RBP: ffff8bf548574080 R08: ffffffffa8c40e10 R09: 0000000000005ffd
  R10: 0000000000000004 R11: ffffffffa8c70e10 R12: ffff8bf551eef400
  R13: 0000000000000000 R14: 0000000000000013 R15: 00000000000003a8
  FS:  00007fae144de8c0(0000) GS:ffff8bf84e780000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00007fae14691690 CR3: 00000001027a2003 CR4: 00000000001706f0
  Call Trace:
   \<TASK\>
   ? \_\_warn+0x12a/0x1d0
   ? \_\_fortify\_report+0x45/0x50
   ? report\_bug+0x154/0x1c0
   ? handle\_bug+0x42/0x70
   ? exc\_invalid\_op+0x1a/0x50
   ? asm\_exc\_invalid\_op+0x1a/0x20
   ? \_\_fortify\_report+0x45/0x50
   \_\_fortify\_panic+0x9/0x10
  \_\_get\_cur\_name\_and\_parent+0x3bc/0x3c0
   get\_cur\_path+0x207/0x3b0
   send\_extent\_data+0x709/0x10d0
   ? find\_parent\_nodes+0x22df/0x25d0
   ? mas\_nomem+0x13/0x90
   ? mtree\_insert\_range+0xa5/0x110
   ? btrfs\_lru\_cache\_store+0x5f/0x1e0
   ? iterate\_extent\_inodes+0x52d/0x5a0
   process\_extent+0xa96/0x11a0
   ? \_\_pfx\_lookup\_backref\_cache+0x10/0x10
   ? \_\_pfx\_store\_backref\_cache+0x10/0x10
   ? \_\_pfx\_iterate\_backrefs+0x10/0x10
   ? \_\_pfx\_check\_extent\_item+0x10/0x10
   changed\_cb+0x6fa/0x930
   ? tree\_advance+0x362/0x390
   ? memcmp\_extent\_buffer+0xd7/0x160
   send\_subvol+0xf0a/0x1520
   btrfs\_ioctl\_send+0x106b/0x11d0
   ? \_\_pfx\_\_\_clone\_root\_cmp\_sort+0x10/0x10
   \_btrfs\_ioctl\_send+0x1ac/0x240
   btrfs\_ioctl+0x75b/0x850
   \_\_se\_sys\_ioctl+0xca/0x150
   do\_syscall\_64+0x85/0x160
   ? \_\_count\_memcg\_events+0x69/0x100
   ? handle\_mm\_fault+0x1327/0x15c0
   ? \_\_se\_sys\_rt\_sigprocmask+0xf1/0x180
   ? syscall\_exit\_to\_user\_mode+0x75/0xa0
   ? do\_syscall\_64+0x91/0x160
   ? do\_user\_addr\_fault+0x21d/0x630
  entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e
  RIP: 0033:0x7fae145eeb4f
  Code: 00 48 89 (...)
  RSP: 002b:00007ffdf1cb09b0 EFLAGS: 00000246 ORIG\_RAX: 0000000000000010
  RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fae145eeb4f
  RDX: 00007ffdf1cb0ad0 RSI: 0000000040489426 RDI: 0000000000000004
  RBP: 00000000000078fe R08: 00007fae144006c0 R09: 00007ffdf1cb0927
  R10: 0000000000000008 R11: 0000000000000246 R12: 00007ffdf1cb1ce8
  R13: 0000000000000003 R14: 000055c499fab2e0 R15: 0000000000000004
   \</TASK\>

Fix this by not storing the NUL string terminator since we don't actually
need it for name cache entries, this way "name\_len" corresponds to the
actual size of the "name" array. This requires marking the "name" array
field with \_\_nonstring and using memcpy() instead of strcpy() as
recommended by the guidelines at:

   https://github.com/KSPP/linux/issues/90

## Affected and fixed versions

- Linux: \>= c0247d289e73e18f6ddb0895de30c09770fbed95, \< 843738ede6cb8b959fb22591fcbabe8b456d7216; \>= c0247d289e73e18f6ddb0895de30c09770fbed95, \< 96c6ca71572a3556ed0c37237305657ff47174b7 (cvelist)
- Linux: 6.11 (cvelist)

## Mitigation

- Upgrade Linux to 96c6ca71572a3556ed0c37237305657ff47174b7 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-49869. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-49869.md
Affected: Linux >= c0247d289e73e18f6ddb0895de30c09770fbed95, < 843738ede6cb8b959fb22591fcbabe8b456d7216; >= c0247d289e73e18f6ddb0895de30c09770fbed95, < 96c6ca71572a3556ed0c37237305657ff47174b7; Linux 6.11
Fixed in: Linux 843738ede6cb8b959fb22591fcbabe8b456d7216, Linux 96c6ca71572a3556ed0c37237305657ff47174b7

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.
```

## FAQ

### Is CVE-2024-49869 being exploited?

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

### How serious is CVE-2024-49869?

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

### Which versions are affected by CVE-2024-49869?

Linux \>= c0247d289e73e18f6ddb0895de30c09770fbed95, \< 843738ede6cb8b959fb22591fcbabe8b456d7216; \>= c0247d289e73e18f6ddb0895de30c09770fbed95, \< 96c6ca71572a3556ed0c37237305657ff47174b7; Linux 6.11.

### Is there a fix for CVE-2024-49869?

Yes. Fixed in Linux 843738ede6cb8b959fb22591fcbabe8b456d7216, Linux 96c6ca71572a3556ed0c37237305657ff47174b7. Upgrade Linux to 96c6ca71572a3556ed0c37237305657ff47174b7 or later.

### How do I check if I'm affected by CVE-2024-49869?

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.

## References

- patch: <https://git.kernel.org/stable/c/843738ede6cb8b959fb22591fcbabe8b456d7216>
- patch: <https://git.kernel.org/stable/c/96c6ca71572a3556ed0c37237305657ff47174b7>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-49869>

HTML: <https://flawdb.com/CVE-2024-49869> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-49869>
