Linux Kernel video4linux子系统getsockopt函数内核内存破坏漏洞


发布日期:2010-09-15
更新日期:2010-09-17

受影响系统:
Linux kernel 2.6.x
描述:
--------------------------------------------------------------------------------
BUGTRAQ  ID: 43239
CVE ID: CVE-2010-3081

Linux Kernel是开放源码操作系统Linux所使用的内核。

Linux中compat_alloc_user_space()函数的某些调用程序(如net/compat.c中的compat_mc_getsockopt()函数)没有对返回内存区域执行任何验证,这可能导致内核内存破坏。以下是有漏洞的代码段:

kgf = compat_alloc_user_space(klen+sizeof(*optlen));                           
                                                                               
if (!access_ok(VERIFY_READ, gf32, __COMPAT_GF0_SIZE) ||                        
      __get_user(interface, &gf32->gf_interface) ||                            
      __get_user(fmode, &gf32->gf_fmode) ||                                    
      __get_user(numsrc, &gf32->gf_numsrc) ||                                  
      __put_user(interface, &kgf->gf_interface) ||                             
      __put_user(fmode, &kgf->gf_fmode) ||                                     
      __put_user(numsrc, &kgf->gf_numsrc) ||                                   
      copy_in_user(&kgf->gf_group,&gf32->gf_group,sizeof(kgf->gf_group)))      
          return -EFAULT;                                                      

klen的值是用户空间所提供的非负32位整数,这意味着kgf指针可能回绕执行内核空间中的高位。gf32指针是有效的用户地址空间,结构的内容是受控的。请注意由于使用了nocheck版本的put_user(不会再执行access_ok),受控的值会写入到kgf结构中。

<*来源:H. Peter Anvin (hpa@linux.intel.com)
 
  链接:http://secunia.com/advisories/41462/
        http://sota.gen.nz/compat1/
*>

测试方法:
--------------------------------------------------------------------------------

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

http://www.exploit-db.com/download/15024

建议:
--------------------------------------------------------------------------------
厂商补丁:

Linux
-----
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c41d68a513c71e35a14f66d71782d27a79a81ea6

相关内容