tpm1.c (bb3b6b0fc57182b568ded61c55eff8a02fcfe27b) tpm1.c (64494d39ff630a63b5308042b20132b491e3706b)
1/*
2 * Copyright (C) 2005, 2012 IBM Corporation
3 *
4 * Authors:
5 * Kent Yoder <key@linux.vnet.ibm.com>
6 * Seiji Munetoh <munetoh@jp.ibm.com>
7 * Stefan Berger <stefanb@us.ibm.com>
8 * Reiner Sailer <sailer@watson.ibm.com>

--- 74 unchanged lines hidden (view full) ---

83 u32 converted_event_size;
84 u32 converted_event_type;
85
86 /* read over *pos measurements */
87 do {
88 event = addr;
89
90 /* check if current entry is valid */
1/*
2 * Copyright (C) 2005, 2012 IBM Corporation
3 *
4 * Authors:
5 * Kent Yoder <key@linux.vnet.ibm.com>
6 * Seiji Munetoh <munetoh@jp.ibm.com>
7 * Stefan Berger <stefanb@us.ibm.com>
8 * Reiner Sailer <sailer@watson.ibm.com>

--- 74 unchanged lines hidden (view full) ---

83 u32 converted_event_size;
84 u32 converted_event_type;
85
86 /* read over *pos measurements */
87 do {
88 event = addr;
89
90 /* check if current entry is valid */
91 if (addr + sizeof(struct tcpa_event) >= limit)
91 if (addr + sizeof(struct tcpa_event) > limit)
92 return NULL;
93
94 converted_event_size =
95 do_endian_conversion(event->event_size);
96 converted_event_type =
97 do_endian_conversion(event->event_type);
98
99 if (((converted_event_type == 0) && (converted_event_size == 0))
100 || ((addr + sizeof(struct tcpa_event) + converted_event_size)
92 return NULL;
93
94 converted_event_size =
95 do_endian_conversion(event->event_size);
96 converted_event_type =
97 do_endian_conversion(event->event_type);
98
99 if (((converted_event_type == 0) && (converted_event_size == 0))
100 || ((addr + sizeof(struct tcpa_event) + converted_event_size)
101 >= limit))
101 > limit))
102 return NULL;
103
104 if (i++ == *pos)
105 break;
106
107 addr += (sizeof(struct tcpa_event) + converted_event_size);
108 } while (1);
109

--- 10 unchanged lines hidden (view full) ---

120 u32 converted_event_size;
121 u32 converted_event_type;
122
123 converted_event_size = do_endian_conversion(event->event_size);
124
125 v += sizeof(struct tcpa_event) + converted_event_size;
126
127 /* now check if current entry is valid */
102 return NULL;
103
104 if (i++ == *pos)
105 break;
106
107 addr += (sizeof(struct tcpa_event) + converted_event_size);
108 } while (1);
109

--- 10 unchanged lines hidden (view full) ---

120 u32 converted_event_size;
121 u32 converted_event_type;
122
123 converted_event_size = do_endian_conversion(event->event_size);
124
125 v += sizeof(struct tcpa_event) + converted_event_size;
126
127 /* now check if current entry is valid */
128 if ((v + sizeof(struct tcpa_event)) >= limit)
128 if ((v + sizeof(struct tcpa_event)) > limit)
129 return NULL;
130
131 event = v;
132
133 converted_event_size = do_endian_conversion(event->event_size);
134 converted_event_type = do_endian_conversion(event->event_type);
135
136 if (((converted_event_type == 0) && (converted_event_size == 0)) ||
129 return NULL;
130
131 event = v;
132
133 converted_event_size = do_endian_conversion(event->event_size);
134 converted_event_type = do_endian_conversion(event->event_type);
135
136 if (((converted_event_type == 0) && (converted_event_size == 0)) ||
137 ((v + sizeof(struct tcpa_event) + converted_event_size) >= limit))
137 ((v + sizeof(struct tcpa_event) + converted_event_size) > limit))
138 return NULL;
139
140 (*pos)++;
141 return v;
142}
143
144static void tpm1_bios_measurements_stop(struct seq_file *m, void *v)
145{

--- 156 unchanged lines hidden ---
138 return NULL;
139
140 (*pos)++;
141 return v;
142}
143
144static void tpm1_bios_measurements_stop(struct seq_file *m, void *v)
145{

--- 156 unchanged lines hidden ---