Add range and table revision checking to avoid abend.

PR:bin/169707
Submitted by:Dan Lukes <dan@obluda.cz>
MFC after:3 days.
This commit is contained in:
Takanori Watanabe 2012-07-09 09:38:53 +00:00
parent 5985d61556
commit 2ef23c6d3b

View File

@ -654,16 +654,24 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp)
printf(END_COMMENT);
return;
}
if(sdp->Revision == 1){
printf("\tOLD TCPA spec log found. Dumping not supported.\n");
printf(END_COMMENT);
return;
}
vaddr = (unsigned char *)acpi_map_physical(paddr, len);
vend = vaddr + len;
while (vaddr != NULL) {
if (vaddr + sizeof(struct TCPAevent) >= vend)
if ((vaddr + sizeof(struct TCPAevent) >= vend)||
(vaddr + sizeof(struct TCPAevent) < vaddr))
break;
event = (struct TCPAevent *)(void *)vaddr;
if (vaddr + event->event_size >= vend)
break;
if (vaddr + event->event_size < vaddr)
break;
if (event->event_type == 0 && event->event_size == 0)
break;
#if 0