Skip to contentSkip to conversation

Minor lockdown fixups

PATCH In review Matthew Garrett 2 participants 4 messages Sep 10, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Minor lockdown fixups

Constify some arrays and fix an #ifdef that I typoed.

#1 lore raw

PATCH 1/2 security: constify some arrays in lockdown LSM

No reason for these not to be const.

---
 security/lockdown/lockdown.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
security/lockdown/lockdown.c +2 -2
index 0068cec77c05..8a10b43daf74 100644
@@ -16,7 +16,7 @@
 
 static enum lockdown_reason kernel_locked_down;
 
-static char *lockdown_reasons[LOCKDOWN_CONFIDENTIALITY_MAX+1] = {
+static const char *const lockdown_reasons[LOCKDOWN_CONFIDENTIALITY_MAX+1] = {
 	[LOCKDOWN_NONE] = "none",
 	[LOCKDOWN_MODULE_SIGNATURE] = "unsigned module loading",
 	[LOCKDOWN_DEV_MEM] = "/dev/mem,kmem,port",
@@ -40,7 +40,7 @@ static char *lockdown_reasons[LOCKDOWN_CONFIDENTIALITY_MAX+1] = {
 	[LOCKDOWN_CONFIDENTIALITY_MAX] = "confidentiality",
 };
 
-static enum lockdown_reason lockdown_levels[] = {LOCKDOWN_NONE,
+static const enum lockdown_reason lockdown_levels[] = {LOCKDOWN_NONE,
 						 LOCKDOWN_INTEGRITY_MAX,
 						 LOCKDOWN_CONFIDENTIALITY_MAX};
 
Signature · 1 line
2.23.0.162.g0b9fbb3734-goog
#2 lore raw

PATCH 2/2 kexec: Fix file verification on S390

In reply to Matthew Garrett

I accidentally typoed this #ifdef, so verification would always be disabled.

---
 arch/s390/kernel/kexec_elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/kexec_elf.c +1 -1
index 9b4f37a4edf1..9da6fa30c447 100644
@@ -130,7 +130,7 @@ static int s390_elf_probe(const char *buf, unsigned long len)
 const struct kexec_file_ops s390_kexec_elf_ops = {
 	.probe = s390_elf_probe,
 	.load = s390_elf_load,
-#ifdef CONFIG_KEXEC__SIG
+#ifdef CONFIG_KEXEC_SIG
 	.verify_sig = s390_verify_sig,
 #endif /* CONFIG_KEXEC_SIG */
 };
Signature · 1 line
2.23.0.162.g0b9fbb3734-goog
maintainer
#3 lore raw
In reply to Matthew Garrett
Quoted 2 lines · Matthew Garrett

Constify some arrays and fix an #ifdef that I typoed.

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-lockdown and next-testing

Signature · 2 lines
James Morris
<[email protected]>