Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1142)

Side by Side Diff: src/untrusted/irt/irt_memory.c

Issue 11141016: mprotect system call exposed to the untrusted code. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Split mprotect into separate dev interface. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "native_client/src/untrusted/irt/irt.h" 10 #include "native_client/src/untrusted/irt/irt.h"
(...skipping 27 matching lines...) Expand all
38 if ((uint32_t) rv > 0xffff0000u) 38 if ((uint32_t) rv > 0xffff0000u)
39 return -(int32_t) rv; 39 return -(int32_t) rv;
40 *addr = (void *) (uintptr_t) rv; 40 *addr = (void *) (uintptr_t) rv;
41 return 0; 41 return 0;
42 } 42 }
43 43
44 static int nacl_irt_munmap(void *addr, size_t len) { 44 static int nacl_irt_munmap(void *addr, size_t len) {
45 return -NACL_SYSCALL(munmap)(addr, len); 45 return -NACL_SYSCALL(munmap)(addr, len);
46 } 46 }
47 47
48 static int nacl_irt_mprotect(void *addr, size_t len, int prot) {
Petr Hosek 2012/10/25 18:46:57 Removed as well.
49 return -NACL_SYSCALL(mprotect)(addr, len, prot);
50 }
51
48 const struct nacl_irt_memory nacl_irt_memory = { 52 const struct nacl_irt_memory nacl_irt_memory = {
49 nacl_irt_sysbrk, 53 nacl_irt_sysbrk,
50 nacl_irt_mmap, 54 nacl_irt_mmap,
51 nacl_irt_munmap, 55 nacl_irt_munmap,
56 nacl_irt_mprotect,
Mark Seaborn 2012/10/25 17:05:36 You shouldn't be adding mprotect here.
Petr Hosek 2012/10/25 18:46:57 Removed.
52 }; 57 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698