Re: [PATCH v3] xfs: tie zoned sysfs lifetime to zone info
From: Carlos Maiolino
Date: Tue Jul 07 2026 - 07:38:27 EST
On Sun, 05 Jul 2026 12:23:58 +0800, Cen Zhang wrote:
> The zoned sysfs directory is currently registered as part of the generic
> per-mount sysfs setup, but the data exposed by nr_open_zones has a
> narrower lifetime. mp->m_zone_info is allocated by xfs_mount_zones() and
> freed by xfs_unmount_zones(), while the zoned sysfs kobject remained
> registered until xfs_mount_sysfs_del().
>
> A read of nr_open_zones can therefore enter through the still-live sysfs
> kobject after xfs_unmount_zones() has freed mp->m_zone_info, leading to a
> use-after-free in nr_open_zones_show().
>
> [...]
Applied to for-next, thanks!
[1/1] xfs: tie zoned sysfs lifetime to zone info
commit: befe3d2705dfd18f1257a0674243b0ba5f337e20
Best regards,
--
Carlos Maiolino <cem@xxxxxxxxxx>