Description
In shiftfs, a non-upstream patch to the Linux kernel included in the Ubuntu 5.0 and 5.3 kernel series, shiftfs_btrfs_ioctl_fd_replace() installs an fd referencing a file from the lower filesystem without taking an additional reference to that file. After the btrfs ioctl completes this fd is closed, which then puts a reference to that file, leading to a refcount underflow.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Ubuntu | Shiftfs in the Linux kernel | 5.3.0-11.12 – < 5.3 kernel*, 5.0 kernel – < 5.0.0-35.38 | 5.3 kernel* |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 24.04 LTS | linux-raspi-realtime | No fix yet | — |
| Ubuntu 22.04 LTS | linux-riscv +2 | No fix yet | — |
| Ubuntu 20.04 LTS | linux-gke +5 | No fix yet | — |
| Ubuntu 18.04 LTS | linux-azure | 5.0.0-1025.27~18.04.1 | USN-4184-1 |
| Ubuntu 18.04 LTS | linux-gcp +1 | 5.0.0-1025.26~18.04.1 | USN-4184-1 |
| Ubuntu 18.04 LTS | linux-gcp-edge +2 | No fix yet | — |
| Ubuntu 18.04 LTS | linux-hwe | 5.0.0-35.38~18.04.1 | USN-4184-1 |
| Ubuntu 18.04 LTS | linux-oem-osp1 | 5.0.0-1027.31 | USN-4184-1 |
| Ubuntu 16.04 LTS | linux-hwe-edge | No fix yet | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Exploit-DB 1
- Ubuntu 19.10 - Refcount Underflow and Type Confusion in shiftfs EDB-47693 · dos · Nov 20, 2019 · verified
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 1
- USN-4184-1 linux, linux-aws, linux-azure, linux-gcp, linux-gke-5.0, linux-hwe, linux-kvm, linux-oem-osp1, linux-oracle, linux-raspi2 vulnerabilities Ubuntu Security Notices (USN) · Sep 9, 2026