Go to file
Benjamin Berg 4ee8160c47 um: hostfs: avoid issues on inode number reuse by host
[ Upstream commit 0bc754d1e3 ]

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: 74ce793bcb ("hostfs: Fix ephemeral inodes")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Mickaël Salaün <mic@digikod.net>
Tested-by: Mickaël Salaün <mic@digikod.net>
Link: https://patch.msgid.link/20250214092822.1241575-1-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-04-10 14:37:34 +02:00
arch um: remove copy_from_kernel_nofault_allowed 2025-04-10 14:37:34 +02:00
block block: fix 'kmem_cache of name 'bio-108' already exists' 2025-03-22 12:50:44 -07:00
certs
crypto crypto: ecc - Prevent ecc_digits_from_bytes from reading too many bytes 2025-01-09 13:31:52 +01:00
Documentation dt-bindings: vendor-prefixes: add GOcontroll 2025-04-10 14:37:27 +02:00
drivers iio: adc: ad7124: Fix comparison of channel configs 2025-04-10 14:37:33 +02:00
fs um: hostfs: avoid issues on inode number reuse by host 2025-04-10 14:37:34 +02:00
include coresight-etm4x: add isb() before reading the TRCSTATR 2025-04-10 14:37:32 +02:00
init rust: Disallow BTF generation with Rust + LTO 2025-03-22 12:50:48 -07:00
io_uring io_uring: fix error pbuf checking 2025-03-22 12:50:45 -07:00
ipc ipc: fix memleak if msg_init_ns failed in create_ipc_ns 2024-12-09 10:32:54 +01:00
kernel kexec: initialize ELF lowest address to ULONG_MAX 2025-04-10 14:37:34 +02:00
lib lib: 842: Improve error handling in sw842_compress() 2025-04-10 14:37:30 +02:00
LICENSES
mm x86/mm/pat: Fix VM_PAT handling when fork() fails in copy_page_range() 2025-04-10 14:37:30 +02:00
net netfilter: socket: Lookup orig tuple for IPv6 SNAT 2025-04-07 10:06:36 +02:00
rust rust: lockdep: Remove support for dynamically allocated LockClassKeys 2025-03-22 12:50:50 -07:00
samples samples/landlock: Fix possible NULL dereference in parse_path() 2025-02-08 09:51:57 +01:00
scripts selinux: Chain up tool resolving errors in install_policy.sh 2025-04-10 14:37:26 +02:00
security smack: dont compile ipv6 code unless ipv6 is configured 2025-04-10 14:37:25 +02:00
sound ASoC: ti: j721e-evm: Fix clock configuration for ti,j7200-cpb-audio compatible 2025-04-10 14:37:27 +02:00
tools selftests/mm/cow: fix the incorrect error handling 2025-04-10 14:37:34 +02:00
usr kbuild: hdrcheck: fix cross build with clang 2025-03-13 12:58:38 +01:00
virt KVM: Use dedicated mutex to protect kvm_usage_count to avoid deadlock 2024-10-04 16:29:47 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore Remove *.orig pattern from .gitignore 2024-10-04 16:29:44 +02:00
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS membarrier: riscv: Add full memory barrier in switch_mm() 2024-09-12 11:11:45 +02:00
Makefile Linux 6.6.86 2025-04-07 10:06:37 +02:00
README

Linux kernel

There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first.

In order to build the documentation, use make htmldocs or make pdfdocs. The formatted documentation can also be read online at:

https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory, several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.