Skip to content

Commit

Permalink
security: constify some arrays in lockdown LSM
Browse files Browse the repository at this point in the history
No reason for these not to be const.

Signed-off-by: Matthew Garrett <mjg59@google.com>
Suggested-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
Matthew Garrett authored and James Morris committed Sep 10, 2019
1 parent b602614 commit f8a9bc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions security/lockdown/lockdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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};

Expand Down

0 comments on commit f8a9bc6

Please sign in to comment.