Skip to contentSkip to conversation

Patch "module: merge repetitive strings in module_sig_check()" has been added to the 5.10-stable tree

DISCUSSION Sergey Shtylyov 2 participants 2 messages Mar 22, 2021 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hello!

Quoted 7 lines · Sasha Levin

This is a note to let you know that I've just added the patch titled

module: merge repetitive strings in module_sig_check()

to the 5.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 6 lines

The filename of the patch is:
module-merge-repetitive-strings-in-module_sig_check.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Why add this patch to the -stable tree? It's just a cleanup...

Quoted 35 lines

commit dd8dfb1bde1ec60845b6e32d1150814d8d98b396

Author: Sergey Shtylyov <[email protected]>
Date:   Sat Oct 31 23:06:45 2020 +0300

module: merge repetitive strings in module_sig_check()

[ Upstream commit 705e9195187d85249fbb0eaa844b1604a98fbc9a ]

The 'reason' variable in module_sig_check() points to 3 strings across the *switch* statement, all needlessly starting with the same text. Let's put the starting text into the pr_notice() call -- it saves 21 bytes of the object code (x86 gcc 10.2.1).

kernel/module.c +2 -2
index 94f926473e35..3b6dd8200d3d 100644
@@ -2922,16 +2922,17 @@ static int module_sig_check(struct load_info *info, int flags)
  		 * enforcing, certain errors are non-fatal.
  		 */
  	case -ENODATA:
-		reason = "Loading of unsigned module";
+		reason = "unsigned module";
  		goto decide;
  	case -ENOPKG:
-		reason = "Loading of module with unsupported crypto";
+		reason = "module with unsupported crypto";
  		goto decide;
  	case -ENOKEY:

kernel/module.c static int module_sig_check(struct load_info *info, int flags) · line 2938

Quoted 10 lines
kernel/module.c +3 -2
-		reason = "Loading of module with unavailable key";
+		reason = "module with unavailable key";
  	decide:
  		if (is_module_sig_enforced()) {
-			pr_notice("%s: %s is rejected\n", info->name, reason);
+			pr_notice("%s: loading of %s is rejected\n",
+				  info->name, reason);
  			return -EKEYREJECTED;
  		}
 

MBR, Sergei

#2 lore raw
Quoted 11 lines · Sergey Shtylyov

Hello!

Quoted 7 lines · Sasha Levin

This is a note to let you know that I've just added the patch titled

module: merge repetitive strings in module_sig_check()

to the 5.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 8 lines
Quoted 6 lines

The filename of the patch is:
module-merge-repetitive-strings-in-module_sig_check.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Why add this patch to the -stable tree? It's just a cleanup...

Looks to be needed for ec2a29593c83 ("module: harden ELF info handling")