History

Merge branch 'topic/secureboot' into next

Merge the secureboot support, as well as the IMA changes needed to support it. From Nayna's cover letter: In order to verify the OS kernel on PowerNV systems, secure boot requires X.509 certificates trusted by the platform. These are stored in secure variables controlled by OPAL, called OPAL secure variables. In order to enable users to manage the keys, the secure variables need to be exposed to userspace. OPAL provides the runtime services for the kernel to be able to access the secure variables. This patchset defines the kernel interface for the OPAL APIs. These APIs are used by the hooks, which load these variables to the keyring and expose them to the userspace for reading/writing. Overall, this patchset adds the following support: * expose secure variables to the kernel via OPAL Runtime API interface * expose secure variables to the userspace via kernel sysfs interface * load kernel verification and revocation keys to .platform and .blacklist keyring respectively. The secure variables can be read/written using simple linux utilities cat/hexdump. For example: Path to the secure variables is: /sys/firmware/secvar/vars Each secure variable is listed as directory. $ ls -l total 0 drwxr-xr-x. 2 root root 0 Aug 20 21:20 db drwxr-xr-x. 2 root root 0 Aug 20 21:20 KEK drwxr-xr-x. 2 root root 0 Aug 20 21:20 PK The attributes of each of the secure variables are (for example: PK): $ ls -l total 0 -r--r--r--. 1 root root 4096 Oct 1 15:10 data -r--r--r--. 1 root root 65536 Oct 1 15:10 size --w-------. 1 root root 4096 Oct 1 15:12 update The "data" is used to read the existing variable value using hexdump. The data is stored in ESL format. The "update" is used to write a new value using cat. The update is to be submitted as AUTH file.

Michael Ellerman committed 7 years ago

Commit d34a5702 parents ea458ef 8220e2231 files · +1035 −96Browse files

Showing the changes to include/linux (2 of 31 files). Show all

Unified · Split

2 files
  1. include/linux/ima.h +2 −1
  2. include/linux/sysfs.h +2 −2
include/linux/ima.h+2−1
@@ -29,7 +29,8 @@ extern void ima_kexec_cmdline(const void *buf, int size); · 28 unmodified lines
2929 extern void ima_add_kexec_buffer(struct kimage *image);
3030 #endif
3131
32−#if (defined(CONFIG_X86) && defined(CONFIG_EFI)) || defined(CONFIG_S390)
32+#if (defined(CONFIG_X86) && defined(CONFIG_EFI)) || defined(CONFIG_S390) \
33+ || defined(CONFIG_PPC_SECURE_BOOT)
3334 extern bool arch_ima_get_secureboot(void);
3435 extern const char * const *arch_get_ima_policy(void);
3536 #else
include/linux/sysfs.h+2−2
@@ -196,9 +196,9 @@ struct bin_attribute { · 195 unmodified lines
196196 .size = _size, \
197197 }
198198
199−#define __BIN_ATTR_WO(_name) { \
199+#define __BIN_ATTR_WO(_name, _size) { \
200200 .attr = { .name = __stringify(_name), .mode = 0200 }, \
201− .store = _name##_store, \
201+ .write = _name##_write, \
202202 .size = _size, \
203203 }
204204

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t