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
9fff2fa0
Commit
9fff2fa0
authored
Oct 10, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arm: switch to saner kernel_execve() semantics
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
22e2430d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
29 deletions
+7
-29
arch/arm/Kconfig
arch/arm/Kconfig
+1
-0
arch/arm/include/asm/unistd.h
arch/arm/include/asm/unistd.h
+0
-1
arch/arm/kernel/entry-common.S
arch/arm/kernel/entry-common.S
+4
-25
arch/arm/kernel/process.c
arch/arm/kernel/process.c
+2
-3
No files found.
arch/arm/Kconfig
View file @
9fff2fa0
...
@@ -50,6 +50,7 @@ config ARM
...
@@ -50,6 +50,7 @@ config ARM
select GENERIC_STRNLEN_USER
select GENERIC_STRNLEN_USER
select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
help
help
The ARM series is a line of low-power-consumption RISC chip designs
The ARM series is a line of low-power-consumption RISC chip designs
licensed by ARM Ltd and targeted at embedded applications and
licensed by ARM Ltd and targeted at embedded applications and
...
...
arch/arm/include/asm/unistd.h
View file @
9fff2fa0
...
@@ -470,7 +470,6 @@
...
@@ -470,7 +470,6 @@
#define __ARCH_WANT_SYS_SOCKETCALL
#define __ARCH_WANT_SYS_SOCKETCALL
#endif
#endif
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_KERNEL_EXECVE
/*
/*
* "Conditional" syscalls
* "Conditional" syscalls
...
...
arch/arm/kernel/entry-common.S
View file @
9fff2fa0
...
@@ -86,35 +86,14 @@ ENDPROC(ret_to_user)
...
@@ -86,35 +86,14 @@ ENDPROC(ret_to_user)
*/
*/
ENTRY
(
ret_from_fork
)
ENTRY
(
ret_from_fork
)
bl
schedule_tail
bl
schedule_tail
cmp
r5
,
#
0
movne
r0
,
r4
movne
lr
,
pc
movne
pc
,
r5
get_thread_info
tsk
get_thread_info
tsk
mov
why
,
#
1
b
ret_slow_syscall
b
ret_slow_syscall
ENDPROC
(
ret_from_fork
)
ENDPROC
(
ret_from_fork
)
ENTRY
(
ret_from_kernel_thread
)
UNWIND
(.
fnstart
)
UNWIND
(.
cantunwind
)
bl
schedule_tail
mov
r0
,
r4
adr
lr
,
BSYM
(
1
f
)
@
kernel
threads
should
not
exit
mov
pc
,
r5
1
:
bl
do_exit
nop
UNWIND
(.
fnend
)
ENDPROC
(
ret_from_kernel_thread
)
/*
*
turn
a
kernel
thread
into
userland
process
*
use
:
ret_from_kernel_execve
(
struct
pt_regs
*
normal
)
*/
ENTRY
(
ret_from_kernel_execve
)
mov
why
,
#
0
@
not
a
syscall
str
why
,
[
r0
,
#
S_R0
]
@
...
and
we
want
0
in
->
ARM_r0
as
well
get_thread_info
tsk
@
thread
structure
mov
sp
,
r0
@
stack
pointer
just
under
pt_regs
b
ret_slow_syscall
ENDPROC
(
ret_from_kernel_execve
)
.
equ
NR_syscalls
,
0
.
equ
NR_syscalls
,
0
#define CALL(x) .equ NR_syscalls,NR_syscalls+1
#define CALL(x) .equ NR_syscalls,NR_syscalls+1
#include "calls.S"
#include "calls.S"
...
...
arch/arm/kernel/process.c
View file @
9fff2fa0
...
@@ -373,7 +373,6 @@ void release_thread(struct task_struct *dead_task)
...
@@ -373,7 +373,6 @@ void release_thread(struct task_struct *dead_task)
}
}
asmlinkage
void
ret_from_fork
(
void
)
__asm__
(
"ret_from_fork"
);
asmlinkage
void
ret_from_fork
(
void
)
__asm__
(
"ret_from_fork"
);
asmlinkage
void
ret_from_kernel_thread
(
void
)
__asm__
(
"ret_from_kernel_thread"
);
int
int
copy_thread
(
unsigned
long
clone_flags
,
unsigned
long
stack_start
,
copy_thread
(
unsigned
long
clone_flags
,
unsigned
long
stack_start
,
...
@@ -388,13 +387,13 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
...
@@ -388,13 +387,13 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
*
childregs
=
*
regs
;
*
childregs
=
*
regs
;
childregs
->
ARM_r0
=
0
;
childregs
->
ARM_r0
=
0
;
childregs
->
ARM_sp
=
stack_start
;
childregs
->
ARM_sp
=
stack_start
;
thread
->
cpu_context
.
pc
=
(
unsigned
long
)
ret_from_fork
;
}
else
{
}
else
{
memset
(
childregs
,
0
,
sizeof
(
struct
pt_regs
));
thread
->
cpu_context
.
r4
=
stk_sz
;
thread
->
cpu_context
.
r4
=
stk_sz
;
thread
->
cpu_context
.
r5
=
stack_start
;
thread
->
cpu_context
.
r5
=
stack_start
;
thread
->
cpu_context
.
pc
=
(
unsigned
long
)
ret_from_kernel_thread
;
childregs
->
ARM_cpsr
=
SVC_MODE
;
childregs
->
ARM_cpsr
=
SVC_MODE
;
}
}
thread
->
cpu_context
.
pc
=
(
unsigned
long
)
ret_from_fork
;
thread
->
cpu_context
.
sp
=
(
unsigned
long
)
childregs
;
thread
->
cpu_context
.
sp
=
(
unsigned
long
)
childregs
;
clear_ptrace_hw_breakpoint
(
p
);
clear_ptrace_hw_breakpoint
(
p
);
...
...
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