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
nexedi
linux
Commits
43c2489b
Commit
43c2489b
authored
Apr 08, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotate fs/exec.c with user pointer annotations.
parent
c9a6bc45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
fs/exec.c
fs/exec.c
+9
-6
No files found.
fs/exec.c
View file @
43c2489b
...
@@ -164,13 +164,13 @@ asmlinkage long sys_uselib(const char * library)
...
@@ -164,13 +164,13 @@ asmlinkage long sys_uselib(const char * library)
/*
/*
* count() counts the number of strings in array ARGV.
* count() counts the number of strings in array ARGV.
*/
*/
static
int
count
(
char
*
*
argv
,
int
max
)
static
int
count
(
char
__user
*
__user
*
argv
,
int
max
)
{
{
int
i
=
0
;
int
i
=
0
;
if
(
argv
!=
NULL
)
{
if
(
argv
!=
NULL
)
{
for
(;;)
{
for
(;;)
{
char
*
p
;
char
__user
*
p
;
if
(
get_user
(
p
,
argv
))
if
(
get_user
(
p
,
argv
))
return
-
EFAULT
;
return
-
EFAULT
;
...
@@ -189,14 +189,14 @@ static int count(char ** argv, int max)
...
@@ -189,14 +189,14 @@ static int count(char ** argv, int max)
* memory to free pages in kernel mem. These are in a format ready
* memory to free pages in kernel mem. These are in a format ready
* to be put directly into the top of new user memory.
* to be put directly into the top of new user memory.
*/
*/
int
copy_strings
(
int
argc
,
char
*
*
argv
,
struct
linux_binprm
*
bprm
)
int
copy_strings
(
int
argc
,
char
__user
*
__user
*
argv
,
struct
linux_binprm
*
bprm
)
{
{
struct
page
*
kmapped_page
=
NULL
;
struct
page
*
kmapped_page
=
NULL
;
char
*
kaddr
=
NULL
;
char
*
kaddr
=
NULL
;
int
ret
;
int
ret
;
while
(
argc
--
>
0
)
{
while
(
argc
--
>
0
)
{
char
*
str
;
char
__user
*
str
;
int
len
;
int
len
;
unsigned
long
pos
;
unsigned
long
pos
;
...
@@ -275,7 +275,7 @@ int copy_strings_kernel(int argc,char ** argv, struct linux_binprm *bprm)
...
@@ -275,7 +275,7 @@ int copy_strings_kernel(int argc,char ** argv, struct linux_binprm *bprm)
int
r
;
int
r
;
mm_segment_t
oldfs
=
get_fs
();
mm_segment_t
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
set_fs
(
KERNEL_DS
);
r
=
copy_strings
(
argc
,
argv
,
bprm
);
r
=
copy_strings
(
argc
,
(
char
__user
*
__user
*
)
argv
,
bprm
);
set_fs
(
oldfs
);
set_fs
(
oldfs
);
return
r
;
return
r
;
}
}
...
@@ -1050,7 +1050,10 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
...
@@ -1050,7 +1050,10 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
/*
/*
* sys_execve() executes a new program.
* sys_execve() executes a new program.
*/
*/
int
do_execve
(
char
*
filename
,
char
**
argv
,
char
**
envp
,
struct
pt_regs
*
regs
)
int
do_execve
(
char
*
filename
,
char
__user
*
__user
*
argv
,
char
__user
*
__user
*
envp
,
struct
pt_regs
*
regs
)
{
{
struct
linux_binprm
bprm
;
struct
linux_binprm
bprm
;
struct
file
*
file
;
struct
file
*
file
;
...
...
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