# CVE-2024-46796: smb: client: fix double put of @cfile in smb2\_set\_path\_size()

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

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; 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:** Remote, no login needed
- **EPSS:** 0.80% (percentile 54, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-09-18T07:12:51.038Z
- **Modified:** 2026-08-05T11:38:36.399Z

## Who should check

- Anyone running Linux \>= 1e60bc0e954389af82f1d9a85f13a63f6572350f, \< 5a72d1edb0843e4c927a4096f81e631031c25c28; \>= 71f15c90e785d1de4bcd65a279e7256684c25c0d, \< 762099898309218b4a7954f3d49e985dc4dfd638; \>= 71f15c90e785d1de4bcd65a279e7256684c25c0d, \< f9c169b51b6ce20394594ef674d6b10efba31220; \>= 6.6.32, \< 6.6.51
- Anyone running Linux 6.9

## Description

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

smb: client: fix double put of @cfile in smb2\_set\_path\_size()

If smb2\_compound\_op() is called with a valid @cfile and returned
-EINVAL, we need to call cifs\_get\_writable\_path() before retrying it
as the reference of @cfile was already dropped by previous call.

This fixes the following KASAN splat when running fstests generic/013
against Windows Server 2022:

  CIFS: Attempting to mount //w22-fs0/scratch
  run fstests generic/013 at 2024-09-02 19:48:59
  ==================================================================
  BUG: KASAN: slab-use-after-free in detach\_if\_pending+0xab/0x200
  Write of size 8 at addr ffff88811f1a3730 by task kworker/3:2/176

  CPU: 3 UID: 0 PID: 176 Comm: kworker/3:2 Not tainted 6.11.0-rc6 \#2
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-2.fc40
  04/01/2014
  Workqueue: cifsoplockd cifs\_oplock\_break \[cifs\]
  Call Trace:
   \<TASK\>
   dump\_stack\_lvl+0x5d/0x80
   ? detach\_if\_pending+0xab/0x200
   print\_report+0x156/0x4d9
   ? detach\_if\_pending+0xab/0x200
   ? \_\_virt\_addr\_valid+0x145/0x300
   ? \_\_phys\_addr+0x46/0x90
   ? detach\_if\_pending+0xab/0x200
   kasan\_report+0xda/0x110
   ? detach\_if\_pending+0xab/0x200
   detach\_if\_pending+0xab/0x200
   timer\_delete+0x96/0xe0
   ? \_\_pfx\_timer\_delete+0x10/0x10
   ? rcu\_is\_watching+0x20/0x50
   try\_to\_grab\_pending+0x46/0x3b0
   \_\_cancel\_work+0x89/0x1b0
   ? \_\_pfx\_\_\_cancel\_work+0x10/0x10
   ? kasan\_save\_track+0x14/0x30
   cifs\_close\_deferred\_file+0x110/0x2c0 \[cifs\]
   ? \_\_pfx\_cifs\_close\_deferred\_file+0x10/0x10 \[cifs\]
   ? \_\_pfx\_down\_read+0x10/0x10
   cifs\_oplock\_break+0x4c1/0xa50 \[cifs\]
   ? \_\_pfx\_cifs\_oplock\_break+0x10/0x10 \[cifs\]
   ? lock\_is\_held\_type+0x85/0xf0
   ? mark\_held\_locks+0x1a/0x90
   process\_one\_work+0x4c6/0x9f0
   ? find\_held\_lock+0x8a/0xa0
   ? \_\_pfx\_process\_one\_work+0x10/0x10
   ? lock\_acquired+0x220/0x550
   ? \_\_list\_add\_valid\_or\_report+0x37/0x100
   worker\_thread+0x2e4/0x570
   ? \_\_kthread\_parkme+0xd1/0xf0
   ? \_\_pfx\_worker\_thread+0x10/0x10
   kthread+0x17f/0x1c0
   ? kthread+0xda/0x1c0
   ? \_\_pfx\_kthread+0x10/0x10
   ret\_from\_fork+0x31/0x60
   ? \_\_pfx\_kthread+0x10/0x10
   ret\_from\_fork\_asm+0x1a/0x30
   \</TASK\>

  Allocated by task 1118:
   kasan\_save\_stack+0x30/0x50
   kasan\_save\_track+0x14/0x30
   \_\_kasan\_kmalloc+0xaa/0xb0
   cifs\_new\_fileinfo+0xc8/0x9d0 \[cifs\]
   cifs\_atomic\_open+0x467/0x770 \[cifs\]
   lookup\_open.isra.0+0x665/0x8b0
   path\_openat+0x4c3/0x1380
   do\_filp\_open+0x167/0x270
   do\_sys\_openat2+0x129/0x160
   \_\_x64\_sys\_creat+0xad/0xe0
   do\_syscall\_64+0xbb/0x1d0
   entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f

  Freed by task 83:
   kasan\_save\_stack+0x30/0x50
   kasan\_save\_track+0x14/0x30
   kasan\_save\_free\_info+0x3b/0x70
   poison\_slab\_object+0xe9/0x160
   \_\_kasan\_slab\_free+0x32/0x50
   kfree+0xf2/0x300
   process\_one\_work+0x4c6/0x9f0
   worker\_thread+0x2e4/0x570
   kthread+0x17f/0x1c0
   ret\_from\_fork+0x31/0x60
   ret\_from\_fork\_asm+0x1a/0x30

  Last potentially related work creation:
   kasan\_save\_stack+0x30/0x50
   \_\_kasan\_record\_aux\_stack+0xad/0xc0
   insert\_work+0x29/0xe0
   \_\_queue\_work+0x5ea/0x760
   queue\_work\_on+0x6d/0x90
   \_cifsFileInfo\_put+0x3f6/0x770 \[cifs\]
   smb2\_compound\_op+0x911/0x3940 \[cifs\]
   smb2\_set\_path\_size+0x228/0x270 \[cifs\]
   cifs\_set\_file\_size+0x197/0x460 \[cifs\]
   cifs\_setattr+0xd9c/0x14b0 \[cifs\]
   notify\_change+0x4e3/0x740
   do\_truncate+0xfa/0x180
   vfs\_truncate+0x195/0x200
   \_\_x64\_sys\_truncate+0x109/0x150
   do\_syscall\_64+0xbb/0x1d0
   entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f

## Affected and fixed versions

- Linux: \>= 1e60bc0e954389af82f1d9a85f13a63f6572350f, \< 5a72d1edb0843e4c927a4096f81e631031c25c28; \>= 71f15c90e785d1de4bcd65a279e7256684c25c0d, \< 762099898309218b4a7954f3d49e985dc4dfd638; \>= 71f15c90e785d1de4bcd65a279e7256684c25c0d, \< f9c169b51b6ce20394594ef674d6b10efba31220; \>= 6.6.32, \< 6.6.51 (cvelist)
- Linux: 6.9 (cvelist)

## Mitigation

- Upgrade Linux to 6.6.51 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-46796. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-46796.md
Affected: Linux >= 1e60bc0e954389af82f1d9a85f13a63f6572350f, < 5a72d1edb0843e4c927a4096f81e631031c25c28; >= 71f15c90e785d1de4bcd65a279e7256684c25c0d, < 762099898309218b4a7954f3d49e985dc4dfd638; >= 71f15c90e785d1de4bcd65a279e7256684c25c0d, < f9c169b51b6ce20394594ef674d6b10efba31220; >= 6.6.32, < 6.6.51; Linux…
Fixed in: Linux 5a72d1edb0843e4c927a4096f81e631031c25c28, Linux 762099898309218b4a7954f3d49e985dc4dfd638, Linux 6.6.51

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-46796 being exploited?

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

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

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

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

Linux \>= 1e60bc0e954389af82f1d9a85f13a63f6572350f, \< 5a72d1edb0843e4c927a4096f81e631031c25c28; \>= 71f15c90e785d1de4bcd65a279e7256684c25c0d, \< 762099898309218b4a7954f3d49e985dc4dfd638; \>= 71f15c90e785d1de4bcd65a279e7256684c25c0d, \< f9c169b51b6ce20394594ef674d6b10efba31220; \>= 6.6.32, \< 6.6.51; Linux 6.9.

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

Yes. Fixed in Linux 5a72d1edb0843e4c927a4096f81e631031c25c28, Linux 762099898309218b4a7954f3d49e985dc4dfd638, Linux 6.6.51. Upgrade Linux to 6.6.51 or later.

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

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/5a72d1edb0843e4c927a4096f81e631031c25c28>
- patch: <https://git.kernel.org/stable/c/762099898309218b4a7954f3d49e985dc4dfd638>
- patch: <https://git.kernel.org/stable/c/f9c169b51b6ce20394594ef674d6b10efba31220>

## 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-46796>

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