[PATCH v3 7/9] ubifs: sysfs: Use kset_create_and_add() for ubifs_kset
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sun Nov 8 15:10:42 PST 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ubifs: sysfs: inaccurate Fixes trailer in commit message
--
commit 05ad573fa4719a7a6e36bb8dcf3c9060b5c194b0
Author: Ian Rogers <irogers at google.com>
> ubifs: sysfs: Use kset_create_and_add() for ubifs_kset
>
> ubifs_kset was a static struct kset using a custom ubifs_ktype that
> had no default_groups and no .release callback. With
> CONFIG_DEBUG_KOBJECT_RELEASE=y, unloading the ubifs module while delayed
> kobject release is pending causes a use-after-free on the static kset.
>
> Replace the static ubifs_kset and empty ubifs_ktype with a dynamically
> allocated kset via kset_create_and_add().
>
> Fixes: 203a55f04f66 ("ubifs: Fix memory leak in ubifs_sysfs_init()")
> Tested-by: Zhihao Cheng <chengzhihao1 at huawei.com>
> Reviewed-by: Zhihao Cheng <chengzhihao1 at huawei.com>
> Signed-off-by: Ian Rogers <irogers at google.com>
[Severity: Low]
203a55f04f66 ("ubifs: Fix memory leak in ubifs_sysfs_init()") only added
an error-path kset_put() when kset_register() fails. The static
ubifs_kset, ubifs_ktype without a release callback, and kset_unregister()
on module exit were introduced in 2e3cbf425804 ("ubifs: Export filesystem
error counters").
Should the Fixes tag instead be:
Fixes: 2e3cbf425804 ("ubifs: Export filesystem error counters")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261108223913.3624571-1-irogers@google.com?part=7
More information about the linux-mtd
mailing list