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
584271bc
Commit
584271bc
authored
Oct 21, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avr32: sanitize copy_thread(), switch to generic fork/vfork/clone, kill wrappers
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
9ac08002
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
47 deletions
+11
-47
arch/avr32/include/asm/unistd.h
arch/avr32/include/asm/unistd.h
+3
-0
arch/avr32/kernel/process.c
arch/avr32/kernel/process.c
+5
-26
arch/avr32/kernel/syscall-stubs.S
arch/avr32/kernel/syscall-stubs.S
+0
-18
arch/avr32/kernel/syscall_table.S
arch/avr32/kernel/syscall_table.S
+3
-3
No files found.
arch/avr32/include/asm/unistd.h
View file @
584271bc
...
...
@@ -40,6 +40,9 @@
#define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE
/*
* "Conditional" syscalls
...
...
arch/avr32/kernel/process.c
View file @
584271bc
...
...
@@ -299,11 +299,11 @@ asmlinkage void syscall_return(void);
int
copy_thread
(
unsigned
long
clone_flags
,
unsigned
long
usp
,
unsigned
long
arg
,
struct
task_struct
*
p
,
struct
pt_regs
*
regs
)
struct
task_struct
*
p
,
struct
pt_regs
*
unused
)
{
struct
pt_regs
*
childregs
=
task_pt_regs
(
p
);
if
(
unlikely
(
!
regs
))
{
if
(
unlikely
(
p
->
flags
&
PF_KTHREAD
))
{
memset
(
childregs
,
0
,
sizeof
(
struct
pt_regs
));
p
->
thread
.
cpu_context
.
r0
=
arg
;
p
->
thread
.
cpu_context
.
r1
=
usp
;
/* fn */
...
...
@@ -311,8 +311,9 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
p
->
thread
.
cpu_context
.
pc
=
(
unsigned
long
)
ret_from_kernel_thread
;
childregs
->
sr
=
MODE_SUPERVISOR
;
}
else
{
*
childregs
=
*
regs
;
childregs
->
sp
=
usp
;
*
childregs
=
*
current_pt_regs
();
if
(
usp
)
childregs
->
sp
=
usp
;
childregs
->
r12
=
0
;
/* Set return value for child */
p
->
thread
.
cpu_context
.
pc
=
(
unsigned
long
)
ret_from_fork
;
}
...
...
@@ -327,28 +328,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
return
0
;
}
/* r12-r8 are dummy parameters to force the compiler to use the stack */
asmlinkage
int
sys_fork
(
struct
pt_regs
*
regs
)
{
return
do_fork
(
SIGCHLD
,
regs
->
sp
,
regs
,
0
,
NULL
,
NULL
);
}
asmlinkage
int
sys_clone
(
unsigned
long
clone_flags
,
unsigned
long
newsp
,
void
__user
*
parent_tidptr
,
void
__user
*
child_tidptr
,
struct
pt_regs
*
regs
)
{
if
(
!
newsp
)
newsp
=
regs
->
sp
;
return
do_fork
(
clone_flags
,
newsp
,
regs
,
0
,
parent_tidptr
,
child_tidptr
);
}
asmlinkage
int
sys_vfork
(
struct
pt_regs
*
regs
)
{
return
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
regs
->
sp
,
regs
,
0
,
NULL
,
NULL
);
}
/*
* This function is supposed to answer the question "who called
* schedule()?"
...
...
arch/avr32/kernel/syscall-stubs.S
View file @
584271bc
...
...
@@ -32,24 +32,6 @@ __sys_rt_sigreturn:
mov
r12
,
sp
rjmp
sys_rt_sigreturn
.
global
__sys_fork
.
type
__sys_fork
,
@
function
__sys_fork
:
mov
r12
,
sp
rjmp
sys_fork
.
global
__sys_clone
.
type
__sys_clone
,
@
function
__sys_clone
:
mov
r8
,
sp
rjmp
sys_clone
.
global
__sys_vfork
.
type
__sys_vfork
,
@
function
__sys_vfork
:
mov
r12
,
sp
rjmp
sys_vfork
.
global
__sys_mmap2
.
type
__sys_mmap2
,
@
function
__sys_mmap2
:
...
...
arch/avr32/kernel/syscall_table.S
View file @
584271bc
...
...
@@ -15,7 +15,7 @@
sys_call_table
:
.
long
sys_restart_syscall
.
long
sys_exit
.
long
__
sys_fork
.
long
sys_fork
.
long
sys_read
.
long
sys_write
.
long
sys_open
/*
5
*/
...
...
@@ -57,7 +57,7 @@ sys_call_table:
.
long
sys_dup
.
long
sys_pipe
.
long
sys_times
.
long
__
sys_clone
.
long
sys_clone
.
long
sys_brk
/*
45
*/
.
long
sys_setgid
.
long
sys_getgid
...
...
@@ -127,7 +127,7 @@ sys_call_table:
.
long
sys_newuname
.
long
sys_adjtimex
.
long
sys_mprotect
.
long
__
sys_vfork
.
long
sys_vfork
.
long
sys_init_module
/*
115
*/
.
long
sys_delete_module
.
long
sys_quotactl
...
...
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