OpenCloudOS-Kernel/fs/hostfs
Johannes Berg ea4f779462 hostfs: fix dev_t handling
commit 267ed02c2121b75e0eaaa338240453b576039e4a upstream.

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.

Cc: stable@vger.kernel.org
Fixes: 74ce793bcb ("hostfs: Fix ephemeral inodes")
Link: https://patch.msgid.link/20240702092440.acc960585dd5.Id0767e12f562a69c6cd3c3262dc3d765db350cf6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-03 08:54:22 +02:00
..
Makefile um: hostfs: define our own API boundary 2023-04-20 23:04:40 +02:00
hostfs.h hostfs: fix dev_t handling 2024-08-03 08:54:22 +02:00
hostfs_kern.c hostfs: fix dev_t handling 2024-08-03 08:54:22 +02:00
hostfs_user.c hostfs: fix dev_t handling 2024-08-03 08:54:22 +02:00
hostfs_user_exp.c um: hostfs: define our own API boundary 2023-04-20 23:04:40 +02:00