Commit 6dd90afb authored by Petr Pavlu's avatar Petr Pavlu Committed by Greg Kroah-Hartman
Browse files

module: Prevent silent truncation of module name in delete_module(2)



[ Upstream commit a6323bd4 ]

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: default avatarPetr Pavlu <petr.pavlu@suse.com>
Reviewed-by: default avatarDaniel Gomez <da.gomez@samsung.com>
Link: https://lore.kernel.org/r/20250630143535.267745-2-petr.pavlu@suse.com


Signed-off-by: default avatarDaniel Gomez <da.gomez@samsung.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d386c8e4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment