x86/ima: define arch_ima_get_secureboot

Distros are concerned about totally disabling the kexec_load syscall.
As a compromise, the kexec_load syscall will only be disabled when
CONFIG_KEXEC_VERIFY_SIG is configured and the system is booted with
secureboot enabled.

This patch defines the new arch specific function called
arch_ima_get_secureboot() to retrieve the secureboot state of the system.

Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
Suggested-by: Seth Forshee <seth.forshee@canonical.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Peter Jones <pjones@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
这个提交包含在:
Nayna Jain
2018-10-09 23:00:33 +05:30
提交者 Mimi Zohar
父节点 59637d5e16
当前提交 0914ade209
修改 3 个文件,包含 28 行新增0 行删除

17
arch/x86/kernel/ima_arch.c 普通文件
查看文件

@@ -0,0 +1,17 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2018 IBM Corporation
*/
#include <linux/efi.h>
#include <linux/ima.h>
extern struct boot_params boot_params;
bool arch_ima_get_secureboot(void)
{
if (efi_enabled(EFI_BOOT) &&
(boot_params.secure_boot == efi_secureboot_mode_enabled))
return true;
else
return false;
}