Linux kernel incorrect data offset in Rust configfs callbacks
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.617.3.27.4-rc1In the Linux kernel, the following vulnerability has been resolved:
rust: configfs: fix data offset calculation for subsystem callbacks
`get_group_data()` chooses between `Group::<Parent>::container_of()` and `Subsystem::<Parent>::container_of()` based on whether `this` represents the root group of a configfs subsystem. It detects this by checking `(*this).cg_subsys.is_null()`, but `link_group()` in `fs/configfs/dir.c` unconditionally sets `cg_subsys` for every `config_group` attached anywhere in a registered subsystem, including the subsystem's own `su_group`. The only `config_group` with a NULL `cg_subsys` is the configfs root, on which userspace cannot trigger callbacks. The check is therefore always false at runtime, and the `Subsystem` branch is dead. Subsystem-level callbacks reach the `Group` branch and may read `data` at the wrong offset.
Thus change the `is_root` check to correctly identify whether a group is a root group by comparing `this` to `subsys.su_group`.
[ Andreas: Fix clippy warning on 1.85.0 by moving safety comment. ]
From the CVE record · Linux
Rust configfs in the Linux kernel can calculate the wrong data offset for subsystem-level callbacks, causing them to read data from the wrong location. The description does not establish whether an attacker can trigger this, or specify access, authentication, or user-interaction requirements.
Engineers running Linux kernels with Rust configfs support should check their deployments; affected versions are not specified.