|
FreeBSD i386_set_ldt Integer Signedness Vulnerability
iDefense Security Advisory 09.23.06
http://www.idefense.com/intelligence/vulnerabilities/
Sep 23, 2006
I. BACKGROUND
FreeBSD is a modern operating system for x86, amd64, Alpha, IA-64, PC-98
and SPARC architectures. It's based on the UNIX operating system, BSD,
which was created at the University of California, Berkeley. More
information can be obtained from the FreeBSD Project web site at
http://www.FreeBSD.org/
II. DESCRIPTION
Local exploitation of an integer signedness vulnerability in version 5.4
of FreeBSD allows attackers to create a denial of service condition.
The i386_set_ldt() call is provided to allow user-land programs to
dynamically manage the per-process local descriptor table.
Due to the use of signed integers and a lack of proper input validation,
a situation can occur in the kernel where bzero is called with a very
large size parameter. The affected code follows.
415 int error = 0, i;
416 int largest_ld;
..
449 largest_ld = uap->start + uap->num;
450 if (largest_ld > pldt->ldt_len)
451 largest_ld = pldt->ldt_len;
452 i = largest_ld - uap->start;
453 bzero(&((union descriptor
*)(pldt->ldt_base))[uap->start],
454 sizeof(union descriptor) * i);
As seen on lines 415 and 416, the 'i' and 'largest_ld' variables are
both signed integers. On line 449, uap->start and uap->num are added
together. It should be noted that both of these variables are user
controlled and are not checked properly. On line 452, 'i' can be set to
a negative value which causes the bzero on line 453 to be called with a
very large length parameter. Invalid memory access will result in a
kernel panic.
III. ANALYSIS
Exploitation of this vulnerability would result in a denial of service
condition on the affected host.
IV. DETECTION
iDefense has confirmed the existence of this problem in FreeBSD 5.5. It
is suspected that versions as early as 5.2 are also affected.
V. WORKAROUND
iDefense is not aware of any workarounds for this issue.
VI. VENDOR RESPONSE
"The policy of the FreeBSD Security Team is to not issue security
advisories for local denial of service attacks; since we have not been
able to demonstrate that this bug can result in anything more severe
than a denial of service, we will not be issuing a security advisory
relating to this problem.
It is possible that an Errata Notice will be issued concerning this
problem."
VII. CVE INFORMATION
The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CVE-2006-4178 to this issue. This is a candidate for inclusion in
the CVE list (http://cve.mitre.org), which standardizes names for
security problems.
VIII. DISCLOSURE TIMELINE
08/16/2006 Initial vendor notification
08/16/2006 Initial vendor response
09/23/2006 Public disclosure
IX. CREDIT
The discoverer of this vulnerability wishes to remain anonymous.
Get paid for vulnerability research
http://www.idefense.com/methodology/vulnerability/vcp.php
Free tools, research and upcoming events
http://labs.idefense.com/
X. LEGAL NOTICES
Copyright =A9 2006 iDefense, Inc.
Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDefense. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email customerservice@idefense.com for permission.
Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.