aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/boot/compressed')
-rw-r--r--arch/x86/boot/compressed/aslr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/boot/compressed/aslr.c b/arch/x86/boot/compressed/aslr.c
index fc6091abedb7..d39189ba7f8e 100644
--- a/arch/x86/boot/compressed/aslr.c
+++ b/arch/x86/boot/compressed/aslr.c
@@ -183,12 +183,27 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size,
183static bool mem_avoid_overlap(struct mem_vector *img) 183static bool mem_avoid_overlap(struct mem_vector *img)
184{ 184{
185 int i; 185 int i;
186 struct setup_data *ptr;
186 187
187 for (i = 0; i < MEM_AVOID_MAX; i++) { 188 for (i = 0; i < MEM_AVOID_MAX; i++) {
188 if (mem_overlaps(img, &mem_avoid[i])) 189 if (mem_overlaps(img, &mem_avoid[i]))
189 return true; 190 return true;
190 } 191 }
191 192
193 /* Avoid all entries in the setup_data linked list. */
194 ptr = (struct setup_data *)(unsigned long)real_mode->hdr.setup_data;
195 while (ptr) {
196 struct mem_vector avoid;
197
198 avoid.start = (u64)ptr;
199 avoid.size = sizeof(*ptr) + ptr->len;
200
201 if (mem_overlaps(img, &avoid))
202 return true;
203
204 ptr = (struct setup_data *)(unsigned long)ptr->next;
205 }
206
192 return false; 207 return false;
193} 208}
194 209