Cloudanix VulnDB

CVE-2025-40205

None

CVSS

—

EPSS

0.2%

Published

Nov 12, 2025

CISA due date

—

The record

In the Linux kernel, the following vulnerability has been resolved: btrfs: avoid potential out-of-bounds in btrfs_encode_fh() The function btrfs_encode_fh() does not properly account for the three cases it handles. Before writing to the file handle (fh), the function only returns to the user BTRFS_FID_SIZE_NON_CONNECTABLE (5 dwords, 20 bytes) or BTRFS_FID_SIZE_CONNECTABLE (8 dwords, 32 bytes). However, when a parent exists and the root ID of the parent and the inode are different, the function writes BTRFS_FID_SIZE_CONNECTABLE_ROOT (10 dwords, 40 bytes). If *max_len is not large enough, this write goes out of bounds because BTRFS_FID_SIZE_CONNECTABLE_ROOT is greater than BTRFS_FID_SIZE_CONNECTABLE originally returned. This results in an 8-byte out-of-bounds write at fid->parent_root_objectid = parent_root_id. A previous attempt to fix this issue was made but was lost. https://lore.kernel.org/all/4CADAEEC020000780001B32C@vpn.id2.novell.com/ Although this issue does not seem to be easily triggerable, it is a potential memory corruption bug that should be fixed. This patch resolves the issue by ensuring the function returns the appropriate size for all three cases and validates that *max_len is large enough before writing any data.

Affected packages

Ecosystem Package Introduced Fixed
Linux Kernel 2.6.29 5.4.301
SUSE:Linux Enterprise High Availability Extension 15 SP6 kernel-default 0 6.4.0-150600.23.81.3
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-default 0 6.4.0-150600.23.81.3
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-livepatch-SLE15-SP6-RT_Update_18 0 1-150600.1.3.1
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-livepatch-SLE15-SP6_Update_18 0 1-150600.13.3.3
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-64kb 0 6.4.0-150600.23.81.3
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-default 0 6.4.0-150600.23.81.3
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-default-base 0 6.4.0-150600.23.81.3.150600.12.36.3
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-source 0 6.4.0-150600.23.81.2
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-zfcpdump 0 6.4.0-150600.23.81.3
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-docs 0 6.4.0-150600.23.81.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-obs-build 0 6.4.0-150600.23.81.3
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-source 0 6.4.0-150600.23.81.2
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-syms 0 6.4.0-150600.23.81.1
SUSE:Linux Enterprise Module for Legacy 15 SP6 kernel-default 0 6.4.0-150600.23.81.3
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-azure 0 6.4.0-150600.8.58.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-source-azure 0 6.4.0-150600.8.58.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-syms-azure 0 6.4.0-150600.8.58.1
SUSE:Linux Enterprise Workstation Extension 15 SP6 kernel-default 0 6.4.0-150600.23.81.3
SUSE:Real Time Module 15 SP6 kernel-rt 0 6.4.0-150600.10.61.1
SUSE:Real Time Module 15 SP6 kernel-rt_debug 0 6.4.0-150600.10.61.1
SUSE:Real Time Module 15 SP6 kernel-source-rt 0 6.4.0-150600.10.61.1
SUSE:Real Time Module 15 SP6 kernel-syms-rt 0 6.4.0-150600.10.61.1
openSUSE:Leap 15.6 dtb-aarch64 0 6.4.0-150600.23.81.1
openSUSE:Leap 15.6 kernel-64kb 0 6.4.0-150600.23.81.3
openSUSE:Leap 15.6 kernel-azure 0 6.4.0-150600.8.58.1
openSUSE:Leap 15.6 kernel-debug 0 6.4.0-150600.23.81.3
openSUSE:Leap 15.6 kernel-default 0 6.4.0-150600.23.81.3
openSUSE:Leap 15.6 kernel-default-base 0 6.4.0-150600.23.81.3.150600.12.36.3
openSUSE:Leap 15.6 kernel-docs 0 6.4.0-150600.23.81.1
openSUSE:Leap 15.6 kernel-kvmsmall 0 6.4.0-150600.23.81.3
openSUSE:Leap 15.6 kernel-obs-build 0 6.4.0-150600.23.81.3
openSUSE:Leap 15.6 kernel-obs-qa 0 6.4.0-150600.23.81.1
openSUSE:Leap 15.6 kernel-rt 0 6.4.0-150600.10.61.1
openSUSE:Leap 15.6 kernel-rt_debug 0 6.4.0-150600.10.61.1
openSUSE:Leap 15.6 kernel-source 0 6.4.0-150600.23.81.2
openSUSE:Leap 15.6 kernel-source-azure 0 6.4.0-150600.8.58.1
openSUSE:Leap 15.6 kernel-source-rt 0 6.4.0-150600.10.61.1
openSUSE:Leap 15.6 kernel-syms 0 6.4.0-150600.23.81.1
openSUSE:Leap 15.6 kernel-syms-azure 0 6.4.0-150600.8.58.1
openSUSE:Leap 15.6 kernel-syms-rt 0 6.4.0-150600.10.61.1
openSUSE:Leap 15.6 kernel-zfcpdump 0 6.4.0-150600.23.81.3
openSUSE:Leap 16.0 dtb-aarch64 0 6.12.0-160000.8.1
openSUSE:Leap 16.0 kernel-64kb 0 6.12.0-160000.8.1
openSUSE:Leap 16.0 kernel-default 0 6.12.0-160000.8.1
openSUSE:Leap 16.0 kernel-default-base 0 6.12.0-160000.8.1.160000.2.5
openSUSE:Leap 16.0 kernel-docs 0 6.12.0-160000.8.1
openSUSE:Leap 16.0 kernel-kvmsmall 0 6.12.0-160000.8.1
openSUSE:Leap 16.0 kernel-obs-build 0 6.12.0-160000.8.1
openSUSE:Leap 16.0 kernel-obs-qa 0 6.12.0-160000.8.1
openSUSE:Leap 16.0 kernel-rt 0 6.12.0-160000.8.1
openSUSE:Leap 16.0 kernel-source 0 6.12.0-160000.8.1
openSUSE:Leap 16.0 kernel-syms 0 6.12.0-160000.8.1
openSUSE:Leap 16.0 kernel-zfcpdump 0 6.12.0-160000.8.1

Related vulnerabilities