Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
cc92c28b
Commit
cc92c28b
authored
Jun 14, 2010
by
Nicolas Pitre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] add address randomization to mmap()
Signed-off-by:
Nicolas Pitre
<
nicolas.pitre@linaro.org
>
parent
990cb8ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
arch/arm/mm/mmap.c
arch/arm/mm/mmap.c
+4
-0
No files found.
arch/arm/mm/mmap.c
View file @
cc92c28b
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include <linux/shm.h>
#include <linux/shm.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/io.h>
#include <linux/io.h>
#include <linux/random.h>
#include <asm/cputype.h>
#include <asm/cputype.h>
#include <asm/system.h>
#include <asm/system.h>
...
@@ -80,6 +81,9 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
...
@@ -80,6 +81,9 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
start_addr
=
addr
=
TASK_UNMAPPED_BASE
;
start_addr
=
addr
=
TASK_UNMAPPED_BASE
;
mm
->
cached_hole_size
=
0
;
mm
->
cached_hole_size
=
0
;
}
}
/* 8 bits of randomness in 20 address space bits */
if
(
current
->
flags
&
PF_RANDOMIZE
)
addr
+=
(
get_random_int
()
%
(
1
<<
8
))
<<
PAGE_SHIFT
;
full_search:
full_search:
if
(
do_align
)
if
(
do_align
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment