<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/hostfs, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-04-10T12:37:34+00:00</updated>
<entry>
<title>um: hostfs: avoid issues on inode number reuse by host</title>
<updated>2025-04-10T12:37:34+00:00</updated>
<author>
<name>Benjamin Berg</name>
<email>benjamin.berg@intel.com</email>
</author>
<published>2025-02-14T09:28:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4ee8160c47e0c0413300df2f7d1423ea275d0477'/>
<id>urn:sha1:4ee8160c47e0c0413300df2f7d1423ea275d0477</id>
<content type='text'>
[ Upstream commit 0bc754d1e31f40f4a343b692096d9e092ccc0370 ]

Some file systems (e.g. ext4) may reuse inode numbers once the inode is
not in use anymore. Usually hostfs will keep an FD open for each inode,
but this is not always the case. In the case of sockets, this cannot
even be done properly.

As such, the following sequence of events was possible:
 * application creates and deletes a socket
 * hostfs creates/deletes the socket on the host
 * inode is still in the hostfs cache
 * hostfs creates a new file
 * ext4 on the outside reuses the inode number
 * hostfs finds the socket inode for the newly created file
 * application receives -ENXIO when opening the file

As mentioned, this can only happen if the deleted file is a special file
that is never opened on the host (i.e. no .open fop).

As such, to prevent issues, it is sufficient to check that the inode
has the expected type. That said, also add a check for the inode birth
time, just to be on the safe side.

Fixes: 74ce793bcbde ("hostfs: Fix ephemeral inodes")
Signed-off-by: Benjamin Berg &lt;benjamin.berg@intel.com&gt;
Reviewed-by: Mickaël Salaün &lt;mic@digikod.net&gt;
Tested-by: Mickaël Salaün &lt;mic@digikod.net&gt;
Link: https://patch.msgid.link/20250214092822.1241575-1-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Revert "hostfs: convert hostfs to use the new mount API"</title>
<updated>2025-02-11T08:37:33+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2025-02-11T08:21:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c903f4959a594e2d4fb253054a71b7256c49268a'/>
<id>urn:sha1:c903f4959a594e2d4fb253054a71b7256c49268a</id>
<content type='text'>
This reverts commit d073828fe0f5cd9531bb918ab0b5a7b920b1bfdb which is
commit cd140ce9f611a5e9d2a5989a282b75e55c71dab3 upstream.

It is reported to cause build issues and odds are the root problem isn't
really an issue on the 6.6.y branch anyway.  If it is, someone can
provide a working set of backported patches.

Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/cd10a924-ae65-4b02-aea2-e629947ca7a3@roeck-us.net
Cc: Hongbo Li &lt;lihongbo22@huawei.com&gt;
Cc: Christian Brauner &lt;brauner@kernel.org&gt;
Cc: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "hostfs: fix string handling in __dentry_name()"</title>
<updated>2025-02-11T08:37:33+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2025-02-11T08:20:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f55d1ee3a43cec45232f18542c9b5841ac8527c2'/>
<id>urn:sha1:f55d1ee3a43cec45232f18542c9b5841ac8527c2</id>
<content type='text'>
This reverts commit 86ec56b25476758f708328b2eeed68918567efd0 which is
commit 60a6002432448bb3f291d80768ae98d62efc9c77 upstream.

It is reported to cause build issues and odds are the root problem isn't
really an issue on the 6.6.y branch anyway.  If it is, someone can
provide a working set of backported patches.

Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/cd10a924-ae65-4b02-aea2-e629947ca7a3@roeck-us.net
Cc: Hongbo Li &lt;lihongbo22@huawei.com&gt;
Cc: Christian Brauner &lt;brauner@kernel.org&gt;
Cc: Sasha Levin &lt;sashal@kernel.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "hostfs: Add const qualifier to host_root in hostfs_fill_super()"</title>
<updated>2025-02-11T08:37:33+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2025-02-11T08:20:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dd942aca6445eb8dd5447422fdb5c0c829f716bf'/>
<id>urn:sha1:dd942aca6445eb8dd5447422fdb5c0c829f716bf</id>
<content type='text'>
This reverts commit 1fbe93dd7e6a0dab59a5fce99f16703f7d52ed81 which is
commit 104eef133fd9c17e4dc28bf43f592a86f26d8a59 upstream.

It is reported to cause build issues and odds are the root problem isn't
really an issue on the 6.6.y branch anyway.  If it is, someone can
provide a working set of backported patches.

Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/cd10a924-ae65-4b02-aea2-e629947ca7a3@roeck-us.net
Cc: Hongbo Li &lt;lihongbo22@huawei.com&gt;
Cc: Christian Brauner &lt;brauner@kernel.org&gt;
Cc: Sasha Levin &lt;sashal@kernel.org&gt;
Cc: Nathan Chancellor &lt;nathan@kernel.org&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "hostfs: fix the host directory parse when mounting."</title>
<updated>2025-02-11T08:37:32+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2025-02-11T08:20:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fd5799f2ddd4d55e668122e0be5b29d8ff057e71'/>
<id>urn:sha1:fd5799f2ddd4d55e668122e0be5b29d8ff057e71</id>
<content type='text'>
This reverts commit be80de30b347dc2eae35dd5f7905ad9c9167dc08 which is
commit ef9ca17ca458ac7253ae71b552e601e49311fc48 upstream.

It is reported to cause build issues and odds are the root problem isn't
really an issue on the 6.6.y branch anyway.  If it is, someone can
provide a working set of backported patches.

Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/cd10a924-ae65-4b02-aea2-e629947ca7a3@roeck-us.net
Cc: Hongbo Li &lt;lihongbo22@huawei.com&gt;
Cc: Christian Brauner &lt;brauner@kernel.org&gt;
Cc: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>hostfs: fix the host directory parse when mounting.</title>
<updated>2025-02-08T08:52:33+00:00</updated>
<author>
<name>Hongbo Li</name>
<email>lihongbo22@huawei.com</email>
</author>
<published>2024-07-25T06:51:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=be80de30b347dc2eae35dd5f7905ad9c9167dc08'/>
<id>urn:sha1:be80de30b347dc2eae35dd5f7905ad9c9167dc08</id>
<content type='text'>
commit ef9ca17ca458ac7253ae71b552e601e49311fc48 upstream.

hostfs not keep the host directory when mounting. When the host
directory is none (default), fc-&gt;source is used as the host root
directory, and this is wrong. Here we use `parse_monolithic` to
handle the old mount path for parsing the root directory. For new
mount path, The `parse_param` is used for the host directory parse.

Reported-and-tested-by: Maciej Żenczykowski &lt;maze@google.com&gt;
Fixes: cd140ce9f611 ("hostfs: convert hostfs to use the new mount API")
Link: https://lore.kernel.org/all/CANP3RGceNzwdb7w=vPf5=7BCid5HVQDmz1K5kC9JG42+HVAh_g@mail.gmail.com/
Cc: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Hongbo Li &lt;lihongbo22@huawei.com&gt;
Link: https://lore.kernel.org/r/20240725065130.1821964-1-lihongbo22@huawei.com
[brauner: minor fixes]
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>hostfs: Add const qualifier to host_root in hostfs_fill_super()</title>
<updated>2025-02-08T08:52:32+00:00</updated>
<author>
<name>Nathan Chancellor</name>
<email>nathan@kernel.org</email>
</author>
<published>2024-06-11T19:58:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1fbe93dd7e6a0dab59a5fce99f16703f7d52ed81'/>
<id>urn:sha1:1fbe93dd7e6a0dab59a5fce99f16703f7d52ed81</id>
<content type='text'>
commit 104eef133fd9c17e4dc28bf43f592a86f26d8a59 upstream.

After the recent conversion to the new mount API, there is a warning
when building hostfs (which may be upgraded to an error via
CONFIG_WERROR=y):

  fs/hostfs/hostfs_kern.c: In function 'hostfs_fill_super':
  fs/hostfs/hostfs_kern.c:942:27: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    942 |         char *host_root = fc-&gt;source;
        |                           ^~

Add the 'const' qualifier, as host_root will not be modified after its
assignment. Move the assignment to keep the existing reverse Christmas
tree order intact.

Fixes: cd140ce9f611 ("hostfs: convert hostfs to use the new mount API")
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Link: https://lore.kernel.org/r/20240611-hostfs-fix-mount-api-conversion-v1-1-ef75bbc77f44@kernel.org
Acked-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>hostfs: fix string handling in __dentry_name()</title>
<updated>2025-02-08T08:52:32+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2025-01-11T06:37:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=86ec56b25476758f708328b2eeed68918567efd0'/>
<id>urn:sha1:86ec56b25476758f708328b2eeed68918567efd0</id>
<content type='text'>
[ Upstream commit 60a6002432448bb3f291d80768ae98d62efc9c77 ]

strcpy() should not be used with destination potentially overlapping
the source; what's more, strscpy() in there is pointless - we already
know the amount we want to copy; might as well use memcpy().

Fixes: c278e81b8a02 "hostfs: Remove open coded strcpy()"
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hostfs: convert hostfs to use the new mount API</title>
<updated>2025-02-08T08:52:32+00:00</updated>
<author>
<name>Hongbo Li</name>
<email>lihongbo22@huawei.com</email>
</author>
<published>2024-05-30T12:01:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d073828fe0f5cd9531bb918ab0b5a7b920b1bfdb'/>
<id>urn:sha1:d073828fe0f5cd9531bb918ab0b5a7b920b1bfdb</id>
<content type='text'>
[ Upstream commit cd140ce9f611a5e9d2a5989a282b75e55c71dab3 ]

Convert the hostfs filesystem to the new internal mount API as the old
one will be obsoleted and removed.  This allows greater flexibility in
communication of mount parameters between userspace, the VFS and the
filesystem.

See Documentation/filesystems/mount_api.txt for more information.

Signed-off-by: Hongbo Li &lt;lihongbo22@huawei.com&gt;
Link: https://lore.kernel.org/r/20240530120111.3794664-1-lihongbo22@huawei.com
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
Stable-dep-of: 60a600243244 ("hostfs: fix string handling in __dentry_name()")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hostfs: fix dev_t handling</title>
<updated>2024-08-03T06:54:22+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2024-07-02T07:24:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ea4f77946226da1ae65e43718ef19e2d45c9da45'/>
<id>urn:sha1:ea4f77946226da1ae65e43718ef19e2d45c9da45</id>
<content type='text'>
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: 74ce793bcbde ("hostfs: Fix ephemeral inodes")
Link: https://patch.msgid.link/20240702092440.acc960585dd5.Id0767e12f562a69c6cd3c3262dc3d765db350cf6@changeid
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
