mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
module: Give MODULE_SIG_STRING a more descriptive name
The purpose of the constant it is not entirely clear from its name. As this constant is going to be exposed in a UAPI header, give it a more specific name for clarity. As all its users call it 'marker', use that wording in the constant itself. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Petr Pavlu <petr.pavlu@suse.com> Reviewed-by: Nicolas Schier <nsc@kernel.org> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
This commit is contained in:
committed by
Sami Tolvanen
parent
acd87264af
commit
2ae4ea2d9a
@@ -70,7 +70,7 @@ int mod_verify_sig(const void *mod, struct load_info *info)
|
||||
int module_sig_check(struct load_info *info, int flags)
|
||||
{
|
||||
int err = -ENODATA;
|
||||
const unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1;
|
||||
const unsigned long markerlen = sizeof(MODULE_SIGNATURE_MARKER) - 1;
|
||||
const char *reason;
|
||||
const void *mod = info->hdr;
|
||||
bool mangled_module = flags & (MODULE_INIT_IGNORE_MODVERSIONS |
|
||||
@@ -81,7 +81,7 @@ int module_sig_check(struct load_info *info, int flags)
|
||||
*/
|
||||
if (!mangled_module &&
|
||||
info->len > markerlen &&
|
||||
memcmp(mod + info->len - markerlen, MODULE_SIG_STRING, markerlen) == 0) {
|
||||
memcmp(mod + info->len - markerlen, MODULE_SIGNATURE_MARKER, markerlen) == 0) {
|
||||
/* We truncate the module to discard the signature */
|
||||
info->len -= markerlen;
|
||||
err = mod_verify_sig(mod, info);
|
||||
|
||||
Reference in New Issue
Block a user