Re: [PATCH] rust: configfs: fix data offset calculation for subsystem callbacks
From: Andreas Hindborg
Date: Tue Sep 29 2026 - 06:22:43 EST
On Mon, 08 Jun 2026 14:32:00 +0200, Andreas Hindborg wrote:
> `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.
>
> [...]
Applied, thanks!
[1/1] rust: configfs: fix data offset calculation for subsystem callbacks
commit: e84c9b64df615e658e47561b835c1364dc48f0c0
Best regards,
--
Andreas Hindborg <a.hindborg@xxxxxxxxxx>