summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authortakawata <takawata@FreeBSD.org>2012-07-09 09:38:53 +0000
committertakawata <takawata@FreeBSD.org>2012-07-09 09:38:53 +0000
commit4eca468ef2ced3eadac43b69f7f926c443daefb9 (patch)
treee5f450b838144033871c52a94b6466dfdc4a0a02 /usr.sbin
parentbe2413da6d7650b12586f84f686f7514f0a6c16b (diff)
downloadFreeBSD-src-4eca468ef2ced3eadac43b69f7f926c443daefb9.zip
FreeBSD-src-4eca468ef2ced3eadac43b69f7f926c443daefb9.tar.gz
Add range and table revision checking to avoid abend.
PR:bin/169707 Submitted by:Dan Lukes <dan@obluda.cz> MFC after:3 days.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/acpi/acpidump/acpi.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c
index f8ac2a3..8a05ef1 100644
--- a/usr.sbin/acpi/acpidump/acpi.c
+++ b/usr.sbin/acpi/acpidump/acpi.c
@@ -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
OpenPOWER on IntegriCloud