Fix unallocated memory access in TPM eventlog code
PATCH 1/1 Fix unallocated memory access in TPM eventlog code
COmmit 0cc698 added support for handling endian fixups in the event log code but broke the binary log file in the process. Keep the endian code, but read the event data from the actual event rather than from unallocated RAM.
---
Should be applied to 4.4
drivers/char/tpm/tpm_eventlog.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/char/tpm/tpm_eventlog.c +6 -1
@@ -244,7 +244,12 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v) tempPtr = (char *)&temp_event; -for (i =0 ; i <sizeof (struct tcpa_event ) + temp_event.event_size; i++) +for (i =0 ; i <sizeof (struct tcpa_event ); i++) +seq_putc (m, tempPtr[i]); + + tempPtr = (char *)&event->event_data; + +for (i =0 ; i < temp_event.event_size; i++)seq_putc (m, tempPtr[i]);return 0 ;
Signature · 9 lines
2.5.0 ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
A message that is not in the archive (sent off-list or not yet received): 1456873414-6127-1-git-send-email-mjg59-JW9irJGTvgXQT0dZR+AlfA@public.gmane.org
Quoted 3 lines · Matthew Garrett
COmmit 0cc698 added support for handling endian fixups in the event log code but broke the binary log file in the process. Keep the endian code, but read the event data from the actual event rather than from unallocated RAM.
This patch is doing the same thing?
Already on it's way to mainline.
drivers/char/tpm/tpm_eventlog.c static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v) · line 253
Quoted 8 lines
drivers/char/tpm/tpm_eventlog.c +6
-1-for (i =0 ; i <sizeof (struct tcpa_event ) + temp_event.event_size; i++) +for (i =0 ; i <sizeof (struct tcpa_event ); i++) +seq_putc (m, tempPtr[i]); + + tempPtr = (char *)&event->event_data; + +for (i =0 ; i < temp_event.event_size; i++)seq_putc (m, tempPtr[i]);
Though this does look more elegant.
Jason
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
A message that is not in the archive (sent off-list or not yet received): 20160302000302.GA447-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Quoted 3 lines · Jason Gunthorpe
Already on it's way to mainline.
Works for me.
------------------------------------------------------------------------------
Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140