landlock: Fix superblock use-after-free in release_inode()

State
Published
Severity
Not Scored
Published
Nov 19, 2026
Updated
Nov 23, 2026
Reserved
Sep 25, 2026

Read the record on cve.org

Description

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

landlock: Fix superblock use-after-free in release_inode()

Without this fix, release_inode() (task 1) can race with a umount operation in hook_sb_delete() (task 2). The order of operations in which the race occurs is:

* task 2: hook_sb_delete() arrives at the end of the function, waiting for landlock_superblock(sb)->inode_refs to become zero. * task 1: release_inode(): does atomic_long_dec_and_test(), decrementing inode_refs to zero. * task 2: gets woken up through some other means, sees that inode_refs is zero and returns. The caller is the unmount operation and proceeds to release the superblock. * task 1: Runs wake_up_var(&landlock_superblock(sb)->inode_refs), *dereferencing the sb_security on the freed-up superblock*.

Notably, wake_up_var() does not dereference the pointer passed to it, and only uses it to determine an overapproximated set of tasks to wake up. So while it's potentially possible for an attacker to provide a different value for that pointer, this only results in the wrong set of tasks getting woken up, and in this scenario, no further tasks are actually waiting.

Nevertheless, KASAN detects it as a slab-use-after-free read on sb->s_security:

BUG: KASAN: slab-use-after-free in release_inode+0x196/0x290 Read of size 8 at addr ffff888103b6c0a8 by task repro/217 release_inode+0x196/0x290 landlock_put_object+0x71/0x90 landlock_free_rules+0x38/0xc0 landlock_put_ruleset+0x47/0x130 fop_ruleset_release+0x33/0x40 __fput+0x305/0x780 Freed by task 54: kfree+0x11c/0x390 process_scheduled_works+0x766/0xe50 worker_thread+0x7bc/0xb20

The fix is to determine &landlock_superblock(inode->i_sb)->inode_refs only once earlier in release_inode(), and later use that precalculated address for the wake_up_var() call, without having to dereference through the superblock.

ProductVersions
Linux Linuxcb2c7d1a1776057c9a1f48ed1250d85e94d4850d to before f8e921fb6367c2b6b64f39943300727f67952362 Affectedcb2c7d1a1776057c9a1f48ed1250d85e94d4850d to before f882b70e659178d9d47d5e191061934660748c82 Affectedcb2c7d1a1776057c9a1f48ed1250d85e94d4850d to before 63bcfd04210960743fc7286796e3c42e731f6707 Affectedcb2c7d1a1776057c9a1f48ed1250d85e94d4850d to before 1824d884e5076e3fdd83f44256746f2f95d062ec Affectedcb2c7d1a1776057c9a1f48ed1250d85e94d4850d to before 2b61008c9f884ead174a67f1cc70342a9efee3e4 Affectedcb2c7d1a1776057c9a1f48ed1250d85e94d4850d to before f79a0195db1f2568fd82999fd814af071b2dbca7 Affectedcb2c7d1a1776057c9a1f48ed1250d85e94d4850d to before 3e271a27c46fd591d1011c7de5a644a41e2010f1 Affected
Linux Linux5.13 Affectedbefore 5.13 Not Affected5.15.226 through 5.15.* Not Affected6.1.193 through 6.1.* Not Affected6.6.163 through 6.6.* Not Affected6.12.117 through 6.12.* Not Affected6.18.61 through 6.18.* Not Affected7.3.2 through 7.3.* Not Affected7.4-rc1 and later Not Affected

Weaknesses

The record names no weakness.

References

Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.

© 2026 NVIDIA, the NVIDIA logo, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.