[PATCH v2] hostfs: fix dev_t handling
Johannes Berg
johannes at sipsolutions.net
Tue Jul 2 00:57:14 PDT 2024
On Tue, 2024-07-02 at 09:24 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg at intel.com>
>
> dev_t is a kernel type and may have different definitions
> in kernel and userspace. On 32-bit x86 this currently makes
> the stat structure being 4 bytes longer in the user code,
> causing stack corruption.
>
> However, this is (potentially) not the only problem, since
> dev_t is a different type on user/kernel side, so we don't
> know that the major/minor encoding isn't also different.
> Decode/encode it instead to address both problems.
>
> Fixes: 74ce793bcbde ("hostfs: Fix ephemeral inodes")
Probably should be Cc: stable too
johannes
More information about the linux-um
mailing list