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
8255b244
Commit
8255b244
authored
Dec 05, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the PROT_EXEC breakage on anonymous mmap.
Clean up the tests while at it.
parent
58d11a39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
mm/mmap.c
mm/mmap.c
+6
-4
No files found.
mm/mmap.c
View file @
8255b244
...
@@ -475,11 +475,13 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
...
@@ -475,11 +475,13 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
struct
rb_node
**
rb_link
,
*
rb_parent
;
struct
rb_node
**
rb_link
,
*
rb_parent
;
unsigned
long
charged
=
0
;
unsigned
long
charged
=
0
;
if
(
file
&&
(
!
file
->
f_op
||
!
file
->
f_op
->
mmap
))
if
(
file
)
{
return
-
ENODEV
;
if
(
!
file
->
f_op
||
!
file
->
f_op
->
mmap
)
return
-
ENODEV
;
if
((
prot
&
PROT_EXEC
)
&&
(
file
->
f_vfsmnt
->
mnt_flags
&
MNT_NOEXEC
))
if
((
prot
&
PROT_EXEC
)
&&
(
file
->
f_vfsmnt
->
mnt_flags
&
MNT_NOEXEC
))
return
-
EPERM
;
return
-
EPERM
;
}
if
(
!
len
)
if
(
!
len
)
return
addr
;
return
addr
;
...
...
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