diff options
| author | Petr Pavlu <[email protected]> | 2025-06-30 14:32:34 +0000 |
|---|---|---|
| committer | Daniel Gomez <[email protected]> | 2025-07-31 11:57:41 +0000 |
| commit | bdc877ba6b7ff1b6d2ebeff11e63da4a50a54854 (patch) | |
| tree | d9e78526601292bb89524106483c3a23f4ccee40 /rust/helpers/time.c | |
| parent | module: Remove unnecessary +1 from last_unloaded_module::name size (diff) | |
| download | kernel-bdc877ba6b7ff1b6d2ebeff11e63da4a50a54854.tar.gz kernel-bdc877ba6b7ff1b6d2ebeff11e63da4a50a54854.zip | |
module: Restore the moduleparam prefix length check
The moduleparam code allows modules to provide their own definition of
MODULE_PARAM_PREFIX, instead of using the default KBUILD_MODNAME ".".
Commit 730b69d22525 ("module: check kernel param length at compile time,
not runtime") added a check to ensure the prefix doesn't exceed
MODULE_NAME_LEN, as this is what param_sysfs_builtin() expects.
Later, commit 58f86cc89c33 ("VERIFY_OCTAL_PERMISSIONS: stricter checking
for sysfs perms.") removed this check, but there is no indication this was
intentional.
Since the check is still useful for param_sysfs_builtin() to function
properly, reintroduce it in __module_param_call(), but in a modernized form
using static_assert().
While here, clean up the __module_param_call() comments. In particular,
remove the comment "Default value instead of permissions?", which comes
from commit 9774a1f54f17 ("[PATCH] Compile-time check re world-writeable
module params"). This comment was related to the test variable
__param_perm_check_##name, which was removed in the previously mentioned
commit 58f86cc89c33.
Fixes: 58f86cc89c33 ("VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms.")
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/time.c')
0 files changed, 0 insertions, 0 deletions
