Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
E-EXK4 - Operating System Group
projects
Linux
Commits
da3d4c5f
Commit
da3d4c5f
authored
12 years ago
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
get rid of pt_regs argument of do_execve()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
d03d26e5
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fs/exec.c
+6
-10
6 additions, 10 deletions
fs/exec.c
include/linux/sched.h
+1
-1
1 addition, 1 deletion
include/linux/sched.h
include/linux/syscalls.h
+1
-2
1 addition, 2 deletions
include/linux/syscalls.h
with
8 additions
and
13 deletions
fs/exec.c
+
6
−
10
View file @
da3d4c5f
...
@@ -1566,12 +1566,11 @@ static int do_execve_common(const char *filename,
...
@@ -1566,12 +1566,11 @@ static int do_execve_common(const char *filename,
int
do_execve
(
const
char
*
filename
,
int
do_execve
(
const
char
*
filename
,
const
char
__user
*
const
__user
*
__argv
,
const
char
__user
*
const
__user
*
__argv
,
const
char
__user
*
const
__user
*
__envp
,
const
char
__user
*
const
__user
*
__envp
)
struct
pt_regs
*
regs
)
{
{
struct
user_arg_ptr
argv
=
{
.
ptr
.
native
=
__argv
};
struct
user_arg_ptr
argv
=
{
.
ptr
.
native
=
__argv
};
struct
user_arg_ptr
envp
=
{
.
ptr
.
native
=
__envp
};
struct
user_arg_ptr
envp
=
{
.
ptr
.
native
=
__envp
};
return
do_execve_common
(
filename
,
argv
,
envp
,
regs
);
return
do_execve_common
(
filename
,
argv
,
envp
,
current_pt_
regs
()
);
}
}
#ifdef CONFIG_COMPAT
#ifdef CONFIG_COMPAT
...
@@ -1668,7 +1667,7 @@ SYSCALL_DEFINE3(execve,
...
@@ -1668,7 +1667,7 @@ SYSCALL_DEFINE3(execve,
struct
filename
*
path
=
getname
(
filename
);
struct
filename
*
path
=
getname
(
filename
);
int
error
=
PTR_ERR
(
path
);
int
error
=
PTR_ERR
(
path
);
if
(
!
IS_ERR
(
path
))
{
if
(
!
IS_ERR
(
path
))
{
error
=
do_execve
(
path
->
name
,
argv
,
envp
,
current_pt_regs
()
);
error
=
do_execve
(
path
->
name
,
argv
,
envp
);
putname
(
path
);
putname
(
path
);
}
}
return
error
;
return
error
;
...
@@ -1694,12 +1693,9 @@ int kernel_execve(const char *filename,
...
@@ -1694,12 +1693,9 @@ int kernel_execve(const char *filename,
const
char
*
const
argv
[],
const
char
*
const
argv
[],
const
char
*
const
envp
[])
const
char
*
const
envp
[])
{
{
struct
pt_regs
*
p
=
current_pt_regs
();
int
ret
=
do_execve
(
filename
,
int
ret
;
ret
=
do_execve
(
filename
,
(
const
char
__user
*
const
__user
*
)
argv
,
(
const
char
__user
*
const
__user
*
)
argv
,
(
const
char
__user
*
const
__user
*
)
envp
,
p
);
(
const
char
__user
*
const
__user
*
)
envp
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
...
@@ -1707,6 +1703,6 @@ int kernel_execve(const char *filename,
...
@@ -1707,6 +1703,6 @@ int kernel_execve(const char *filename,
* We were successful. We won't be returning to our caller, but
* We were successful. We won't be returning to our caller, but
* instead to user space by manipulating the kernel stack.
* instead to user space by manipulating the kernel stack.
*/
*/
ret_from_kernel_execve
(
p
);
ret_from_kernel_execve
(
current_pt_regs
()
);
}
}
#endif
#endif
This diff is collapsed.
Click to expand it.
include/linux/sched.h
+
1
−
1
View file @
da3d4c5f
...
@@ -2288,7 +2288,7 @@ extern int disallow_signal(int);
...
@@ -2288,7 +2288,7 @@ extern int disallow_signal(int);
extern
int
do_execve
(
const
char
*
,
extern
int
do_execve
(
const
char
*
,
const
char
__user
*
const
__user
*
,
const
char
__user
*
const
__user
*
,
const
char
__user
*
const
__user
*
,
struct
pt_regs
*
);
const
char
__user
*
const
__user
*
);
extern
long
do_fork
(
unsigned
long
,
unsigned
long
,
struct
pt_regs
*
,
unsigned
long
,
int
__user
*
,
int
__user
*
);
extern
long
do_fork
(
unsigned
long
,
unsigned
long
,
struct
pt_regs
*
,
unsigned
long
,
int
__user
*
,
int
__user
*
);
struct
task_struct
*
fork_idle
(
int
);
struct
task_struct
*
fork_idle
(
int
);
#ifdef CONFIG_GENERIC_KERNEL_THREAD
#ifdef CONFIG_GENERIC_KERNEL_THREAD
...
...
This diff is collapsed.
Click to expand it.
include/linux/syscalls.h
+
1
−
2
View file @
da3d4c5f
...
@@ -833,8 +833,7 @@ int kernel_execve(const char *filename, const char *const argv[], const char *co
...
@@ -833,8 +833,7 @@ int kernel_execve(const char *filename, const char *const argv[], const char *co
#define kernel_execve(filename, argv, envp) \
#define kernel_execve(filename, argv, envp) \
do_execve(filename, \
do_execve(filename, \
(const char __user *const __user *)argv, \
(const char __user *const __user *)argv, \
(const char __user *const __user *)envp, \
(const char __user *const __user *)envp)
current_pt_regs())
#endif
#endif
asmlinkage
long
sys_execve
(
const
char
__user
*
filename
,
asmlinkage
long
sys_execve
(
const
char
__user
*
filename
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment