linux-yocto/kernel/module
Petr Pavlu 6dd90afb39 module: Prevent silent truncation of module name in delete_module(2)
[ Upstream commit a6323bd4e6 ]

Passing a module name longer than MODULE_NAME_LEN to the delete_module
syscall results in its silent truncation. This really isn't much of
a problem in practice, but it could theoretically lead to the removal of an
incorrect module. It is more sensible to return ENAMETOOLONG or ENOENT in
such a case.

Update the syscall to return ENOENT, as documented in the delete_module(2)
man page to mean "No module by that name exists." This is appropriate
because a module with a name longer than MODULE_NAME_LEN cannot be loaded
in the first place.

Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Link: https://lore.kernel.org/r/20250630143535.267745-2-petr.pavlu@suse.com
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-28 16:28:28 +02:00
..
debug_kmemleak.c module: Move kmemleak support to a separate file 2022-04-05 08:43:04 -07:00
decompress.c module/decompress: use kvmalloc() consistently 2023-11-20 11:59:37 +01:00
dups.c
internal.h
kallsyms.c modpost, kallsyms: Treat add '$'-prefixed symbols as mapping symbols 2023-07-24 12:09:47 -07:00
Kconfig module: sign with sha512 instead of sha1 by default 2025-05-02 07:50:36 +02:00
kdb.c
kmod.c module: add debugging auto-load duplicate module support 2023-04-19 17:26:01 -07:00
livepatch.c
main.c module: Prevent silent truncation of module name in delete_module(2) 2025-08-28 16:28:28 +02:00
Makefile module: Fix KCOV-ignored file name 2024-10-04 16:30:03 +02:00
procfs.c module: replace module_layout with module_memory 2023-03-09 12:55:15 -08:00
signing.c
stats.c
strict_rwx.c
sysfs.c module: remove redundant module_sysfs_initialized variable 2022-11-11 10:19:52 -08:00
tracking.c
tree_lookup.c module: replace module_layout with module_memory 2023-03-09 12:55:15 -08:00
version.c Modules updates for v5.19-rc1 2022-05-26 17:13:43 -07:00