Skip to content
A detailed explainer is available in Japanese. Read the Japanese explainer
Critical 9.8

Linux kernel btrfs の xattr 更新で破損、修正版あり

CVE-2026-98959 First seen on SecPulse

Summary

Linux カーネルの btrfs で、ファイルの拡張属性(xattr)の値を別のサイズに書き換えると、属性が消えたりファイルシステムの整合性エラーが起きたりする不具合が見つかりました。btrfs を使っている Linux 環境が対象で、修正版のカーネルが公開されています。まず btrfs の利用有無とカーネルの版を確認し、修正を含む版かディストリビューションの更新を適用してください。

AI summary

Written by an external AI model and may contain mistakes. Check the original description and references below before acting on it.

Linux カーネルの btrfs で、ファイルの拡張属性(xattr)の値を別のサイズに書き換えると、属性が消えたりファイルシステムの整合性エラーが起きたりする不具合が見つかりました。btrfs を使っている Linux 環境が対象で、修正版のカーネルが公開されています。まず btrfs の利用有無とカーネルの版を確認し、修正を含む版かディストリビューションの更新を適用してください。

Affected packages

EcosystemPackageAffectedFixed
Linux Linux — —
Linux Kernel
≥ 3.19.0, < 6.6.160
≥ 6.7.0, < 6.12.113
≥ 6.13.0, < 6.18.57
≥ 6.19.0, < 7.2.11
6.6.160
6.12.113
6.18.57
7.2.11

Fix status by distribution

Fixed packages published by each distribution for this CVE

Original description The description as published by the source.

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

btrfs: fix xattr replace when multiple xattrs are packed in the same item

If we have a btrfs_dir_item item that packs multiple xattrs and then we
replace the value of one of them (with the setxattr(2) family of syscalls)
with another value of a different size, we end up not having a fully
initialized btrfs_dir_item, resulting in a corruption that the tree
checker will detect at extent buffer writeback time.

This is because in btrfs_setxattr() when we find a btrfs_dir_item with
multiple xattrs (due to the crc32c hash of their name being the same)
we delete one of the xattr items (btrfs_dir_item) and then insert a new
one, but the deletion and insertion results in shifting existing data in
the leaf and therefore when the new value of a xattr has a different size,
the new btrfs_dir_item is placed in a leaf section that was not
initialized and we only copy the value's data and set the value's length
in the new btrfs_dir_item, without setting the name, the name's length,
the key (which must be all zeroes for xattrs), flags (BTRFS_FT_XATTR) and
transaction ID.

The following script reproduces the issue:

$ cat test.sh
#!/bin/bash

DEV=/dev/sdi
MNT=/mnt/sdi

mkfs.btrfs -f $DEV
mount $DEV $MNT

touch $MNT/testfile

Add two xattrs that, on btrfs, have the same hash (crc32c) for their

name and therefore are packed into the same btrfs_dir_item.

setfattr -n user.foobar -v 123 $MNT/testfile
se…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details