aboutsummaryrefslogtreecommitdiffstats
path: root/mm/util.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-07-14 03:50:02 -0400
committerLeann Ogasawara <leann.ogasawara@canonical.com>2011-08-30 13:16:26 -0400
commit775e6e802597c3f6c334cdaaf8df807dd28c6dd6 (patch)
tree21943332a24abf9328e48125c4d7881271d0a6e6 /mm/util.c
parent4aafbee4c985f74a3492fd75d65f16a0b5938612 (diff)
UBUNTU: ubuntu: nx-emu - i386: NX emulation
This is old code with some cruft, all originally by Ingo Molnar with much later rebasing by Fedora folks and at least one arcane fix by Roland McGrath a few years ago. No longer uses exec-shield sysctl, merged with disable_nx. Kees Cook fixed boottime NX reporting for various corner cases. Signed-off-by: Kees Cook <kees.cook@canonical.com> Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Diffstat (limited to 'mm/util.c')
-rw-r--r--mm/util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/util.c b/mm/util.c
index 88ea1bd661c..c4db4127176 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -11,6 +11,11 @@
11#define CREATE_TRACE_POINTS 11#define CREATE_TRACE_POINTS
12#include <trace/events/kmem.h> 12#include <trace/events/kmem.h>
13 13
14/* No sane architecture will #define these to anything else */
15#ifndef arch_add_exec_range
16#define arch_add_exec_range(mm, limit) do { ; } while (0)
17#endif
18
14/** 19/**
15 * kstrdup - allocate space for and copy an existing string 20 * kstrdup - allocate space for and copy an existing string
16 * @s: the string to duplicate 21 * @s: the string to duplicate
@@ -237,6 +242,9 @@ void __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma,
237 vma->vm_next = next; 242 vma->vm_next = next;
238 if (next) 243 if (next)
239 next->vm_prev = vma; 244 next->vm_prev = vma;
245
246 if (vma->vm_flags & VM_EXEC)
247 arch_add_exec_range(mm, vma->vm_end);
240} 248}
241 249
242#if defined(CONFIG_MMU) && !defined(HAVE_ARCH_PICK_MMAP_LAYOUT) 250#if defined(CONFIG_MMU) && !defined(HAVE_ARCH_PICK_MMAP_LAYOUT)