tpmdd updates for Linux v5.8

-----BEGIN PGP SIGNATURE-----
 
 iJYEABYIAD4WIQRE6pSOnaBC00OEHEIaerohdGur0gUCXsf2IyAcamFya2tvLnNh
 a2tpbmVuQGxpbnV4LmludGVsLmNvbQAKCRAaerohdGur0v5IAQC/6dQiHYftVnKX
 ktfqu4xfy9JIv8gA+84CQJmdxDkI5AEAmtkjEzzb7qtG3hOX+XFY1dpg+xRjdppg
 wx8WhfroNg0=
 =UBfK
 -----END PGP SIGNATURE-----

Merge tag 'tpmdd-next-20200522' of git://git.infradead.org/users/jjs/linux-tpmdd

Pull tpm updates from Jarkko Sakkinen.

* tag 'tpmdd-next-20200522' of git://git.infradead.org/users/jjs/linux-tpmdd:
  tpm: eventlog: Replace zero-length array with flexible-array member
  tpm/tpm_ftpm_tee: Use UUID API for exporting the UUID
This commit is contained in:
Linus Torvalds 2020-06-01 11:30:28 -07:00
commit b6f91ab6a2
3 changed files with 7 additions and 9 deletions

View File

@ -51,8 +51,7 @@ static void *tpm2_bios_measurements_start(struct seq_file *m, loff_t *pos)
int i; int i;
event_header = addr; event_header = addr;
size = sizeof(struct tcg_pcr_event) - sizeof(event_header->event) size = struct_size(event_header, event, event_header->event_size);
+ event_header->event_size;
if (*pos == 0) { if (*pos == 0) {
if (addr + size < limit) { if (addr + size < limit) {
@ -98,8 +97,8 @@ static void *tpm2_bios_measurements_next(struct seq_file *m, void *v,
event_header = log->bios_event_log; event_header = log->bios_event_log;
if (v == SEQ_START_TOKEN) { if (v == SEQ_START_TOKEN) {
event_size = sizeof(struct tcg_pcr_event) - event_size = struct_size(event_header, event,
sizeof(event_header->event) + event_header->event_size; event_header->event_size);
marker = event_header; marker = event_header;
} else { } else {
event = v; event = v;
@ -136,9 +135,8 @@ static int tpm2_binary_bios_measurements_show(struct seq_file *m, void *v)
size_t size; size_t size;
if (v == SEQ_START_TOKEN) { if (v == SEQ_START_TOKEN) {
size = sizeof(struct tcg_pcr_event) - size = struct_size(event_header, event,
sizeof(event_header->event) + event_header->event_size; event_header->event_size);
temp_ptr = event_header; temp_ptr = event_header;
if (size > 0) if (size > 0)

View File

@ -241,7 +241,7 @@ static int ftpm_tee_probe(struct platform_device *pdev)
/* Open a session with fTPM TA */ /* Open a session with fTPM TA */
memset(&sess_arg, 0, sizeof(sess_arg)); memset(&sess_arg, 0, sizeof(sess_arg));
memcpy(sess_arg.uuid, ftpm_ta_uuid.b, TEE_IOCTL_UUID_LEN); export_uuid(sess_arg.uuid, &ftpm_ta_uuid);
sess_arg.clnt_login = TEE_IOCTL_LOGIN_PUBLIC; sess_arg.clnt_login = TEE_IOCTL_LOGIN_PUBLIC;
sess_arg.num_params = 0; sess_arg.num_params = 0;

View File

@ -97,7 +97,7 @@ struct tcg_pcr_event {
u32 event_type; u32 event_type;
u8 digest[20]; u8 digest[20];
u32 event_size; u32 event_size;
u8 event[0]; u8 event[];
} __packed; } __packed;
struct tcg_event_field { struct tcg_event_field {