Files
linux-stable-mirror/include/linux
Petr Pavlu b401bee1e6 module: Restore the moduleparam prefix length check
[ Upstream commit bdc877ba6b ]

The moduleparam code allows modules to provide their own definition of
MODULE_PARAM_PREFIX, instead of using the default KBUILD_MODNAME ".".

Commit 730b69d225 ("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 58f86cc89c ("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 9774a1f54f ("[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 58f86cc89c.

Fixes: 58f86cc89c ("VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms.")
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-4-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:22:35 +02:00
..
2024-01-25 14:37:54 -08:00
2025-06-27 11:04:09 +01:00
2024-07-05 09:12:55 +02:00
2024-06-21 14:53:19 +02:00
2024-06-21 14:53:46 +02:00
2024-10-17 15:07:44 +02:00
2025-07-17 18:27:44 +02:00
2024-06-21 14:53:28 +02:00
2025-03-13 12:47:21 +01:00
2024-04-13 12:58:31 +02:00
2025-06-04 14:37:08 +02:00
2025-08-28 16:22:31 +02:00
2025-04-10 14:30:53 +02:00
2025-02-01 18:22:32 +01:00
2025-01-09 13:24:59 +01:00
2025-06-27 11:04:09 +01:00
2024-07-05 09:12:55 +02:00
2025-06-04 14:37:09 +02:00
2024-02-23 08:41:51 +01:00
2024-10-17 15:07:57 +02:00