diff options
| author | Petr Pavlu <[email protected]> | 2025-06-30 14:32:32 +0000 |
|---|---|---|
| committer | Daniel Gomez <[email protected]> | 2025-07-31 11:57:21 +0000 |
| commit | a6323bd4e611567913e23df5b58f2d4e4da06789 (patch) | |
| tree | f05fa6986f0abf77c62c571790464661a70d30ae /rust/helpers/bug.c | |
| parent | kunit: test: Drop CONFIG_MODULE ifdeffery (diff) | |
| download | kernel-a6323bd4e611567913e23df5b58f2d4e4da06789.tar.gz kernel-a6323bd4e611567913e23df5b58f2d4e4da06789.zip | |
module: Prevent silent truncation of module name in delete_module(2)
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 <[email protected]>
Reviewed-by: Daniel Gomez <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Daniel Gomez <[email protected]>
Diffstat (limited to 'rust/helpers/bug.c')
0 files changed, 0 insertions, 0 deletions
