linux-yocto/kernel/module
Petr Pavlu 3276f657a4 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-20 18:30:46 +02:00
..
debug_kmemleak.c module: Refine kmemleak scanned areas 2024-09-13 09:55:17 -07:00
decompress.c
dups.c module: Remove redundant TASK_UNINTERRUPTIBLE 2023-12-19 13:30:28 -08:00
internal.h module: Don't ignore errors from set_memory_XX() 2024-02-16 11:30:43 -08:00
kallsyms.c kallsyms: rework symbol lookup return codes 2024-06-27 17:43:40 +02:00
Kconfig module: sign with sha512 instead of sha1 by default 2025-05-02 07:58:51 +02:00
kdb.c
kmod.c
livepatch.c
main.c module: Prevent silent truncation of module name in delete_module(2) 2025-08-20 18:30:46 +02:00
Makefile module: Fix KCOV-ignored file name 2024-08-08 17:36:35 +02:00
procfs.c
signing.c
stats.c
strict_rwx.c module: Don't ignore errors from set_memory_XX() 2024-02-16 11:30:43 -08:00
sysfs.c module: abort module loading when sysfs setup suffer errors 2024-09-13 09:55:17 -07:00
tracking.c
tree_lookup.c
version.c