Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
9ac08002
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9ac08002
编写于
10月 21, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
arm64: sanitize copy_thread(), switch to generic fork/vfork/clone
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
b9763ce3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
12 addition
and
28 deletion
+12
-28
arch/arm64/Kconfig
arch/arm64/Kconfig
+1
-0
arch/arm64/include/asm/syscalls.h
arch/arm64/include/asm/syscalls.h
+2
-0
arch/arm64/include/asm/unistd.h
arch/arm64/include/asm/unistd.h
+3
-0
arch/arm64/include/asm/unistd32.h
arch/arm64/include/asm/unistd32.h
+2
-2
arch/arm64/kernel/process.c
arch/arm64/kernel/process.c
+4
-4
arch/arm64/kernel/sys.c
arch/arm64/kernel/sys.c
+0
-11
arch/arm64/kernel/sys_compat.c
arch/arm64/kernel/sys_compat.c
+0
-11
未找到文件。
arch/arm64/Kconfig
浏览文件 @
9ac08002
...
@@ -33,6 +33,7 @@ config ARM64
...
@@ -33,6 +33,7 @@ config ARM64
select RTC_LIB
select RTC_LIB
select SPARSE_IRQ
select SPARSE_IRQ
select SYSCTL_EXCEPTION_TRACE
select SYSCTL_EXCEPTION_TRACE
select CLONE_BACKWARDS
help
help
ARM 64-bit (AArch64) Linux support.
ARM 64-bit (AArch64) Linux support.
...
...
arch/arm64/include/asm/syscalls.h
浏览文件 @
9ac08002
...
@@ -31,6 +31,8 @@ asmlinkage long sys_sigaltstack_wrapper(const stack_t __user *uss,
...
@@ -31,6 +31,8 @@ asmlinkage long sys_sigaltstack_wrapper(const stack_t __user *uss,
* AArch64 sys_clone implementation has a different prototype than the generic
* AArch64 sys_clone implementation has a different prototype than the generic
* one (additional TLS value argument).
* one (additional TLS value argument).
*/
*/
asmlinkage
long
sys_clone
(
unsigned
long
,
unsigned
long
,
void
__user
*
,
int
,
void
__user
*
);
#define sys_clone sys_clone
#define sys_clone sys_clone
#include <asm-generic/syscalls.h>
#include <asm-generic/syscalls.h>
...
...
arch/arm64/include/asm/unistd.h
浏览文件 @
9ac08002
...
@@ -24,6 +24,9 @@
...
@@ -24,6 +24,9 @@
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK
#endif
#endif
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE
#include <uapi/asm/unistd.h>
#include <uapi/asm/unistd.h>
arch/arm64/include/asm/unistd32.h
浏览文件 @
9ac08002
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
__SYSCALL
(
0
,
sys_restart_syscall
)
__SYSCALL
(
0
,
sys_restart_syscall
)
__SYSCALL
(
1
,
sys_exit
)
__SYSCALL
(
1
,
sys_exit
)
__SYSCALL
(
2
,
compat_
sys_fork
)
__SYSCALL
(
2
,
sys_fork
)
__SYSCALL
(
3
,
sys_read
)
__SYSCALL
(
3
,
sys_read
)
__SYSCALL
(
4
,
sys_write
)
__SYSCALL
(
4
,
sys_write
)
__SYSCALL
(
5
,
compat_sys_open
)
__SYSCALL
(
5
,
compat_sys_open
)
...
@@ -211,7 +211,7 @@ __SYSCALL(186, compat_sys_sigaltstack_wrapper)
...
@@ -211,7 +211,7 @@ __SYSCALL(186, compat_sys_sigaltstack_wrapper)
__SYSCALL
(
187
,
compat_sys_sendfile
)
__SYSCALL
(
187
,
compat_sys_sendfile
)
__SYSCALL
(
188
,
sys_ni_syscall
)
/* 188 reserved */
__SYSCALL
(
188
,
sys_ni_syscall
)
/* 188 reserved */
__SYSCALL
(
189
,
sys_ni_syscall
)
/* 189 reserved */
__SYSCALL
(
189
,
sys_ni_syscall
)
/* 189 reserved */
__SYSCALL
(
190
,
compat_
sys_vfork
)
__SYSCALL
(
190
,
sys_vfork
)
__SYSCALL
(
191
,
compat_sys_getrlimit
)
/* SuS compliant getrlimit */
__SYSCALL
(
191
,
compat_sys_getrlimit
)
/* SuS compliant getrlimit */
__SYSCALL
(
192
,
sys_mmap_pgoff
)
__SYSCALL
(
192
,
sys_mmap_pgoff
)
__SYSCALL
(
193
,
compat_sys_truncate64_wrapper
)
__SYSCALL
(
193
,
compat_sys_truncate64_wrapper
)
...
...
arch/arm64/kernel/process.c
浏览文件 @
9ac08002
...
@@ -235,15 +235,15 @@ asmlinkage void ret_from_fork(void) asm("ret_from_fork");
...
@@ -235,15 +235,15 @@ asmlinkage void ret_from_fork(void) asm("ret_from_fork");
int
copy_thread
(
unsigned
long
clone_flags
,
unsigned
long
stack_start
,
int
copy_thread
(
unsigned
long
clone_flags
,
unsigned
long
stack_start
,
unsigned
long
stk_sz
,
struct
task_struct
*
p
,
unsigned
long
stk_sz
,
struct
task_struct
*
p
,
struct
pt_regs
*
regs
)
struct
pt_regs
*
unused
)
{
{
struct
pt_regs
*
childregs
=
task_pt_regs
(
p
);
struct
pt_regs
*
childregs
=
task_pt_regs
(
p
);
unsigned
long
tls
=
p
->
thread
.
tp_value
;
unsigned
long
tls
=
p
->
thread
.
tp_value
;
memset
(
&
p
->
thread
.
cpu_context
,
0
,
sizeof
(
struct
cpu_context
));
memset
(
&
p
->
thread
.
cpu_context
,
0
,
sizeof
(
struct
cpu_context
));
if
(
likely
(
regs
))
{
if
(
likely
(
!
(
p
->
flags
&
PF_KTHREAD
)
))
{
*
childregs
=
*
regs
;
*
childregs
=
*
current_pt_regs
()
;
childregs
->
regs
[
0
]
=
0
;
childregs
->
regs
[
0
]
=
0
;
if
(
is_compat_thread
(
task_thread_info
(
p
)))
{
if
(
is_compat_thread
(
task_thread_info
(
p
)))
{
if
(
stack_start
)
if
(
stack_start
)
...
@@ -266,7 +266,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start,
...
@@ -266,7 +266,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start,
* for the new thread.
* for the new thread.
*/
*/
if
(
clone_flags
&
CLONE_SETTLS
)
if
(
clone_flags
&
CLONE_SETTLS
)
tls
=
regs
->
regs
[
3
];
tls
=
child
regs
->
regs
[
3
];
}
else
{
}
else
{
memset
(
childregs
,
0
,
sizeof
(
struct
pt_regs
));
memset
(
childregs
,
0
,
sizeof
(
struct
pt_regs
));
childregs
->
pstate
=
PSR_MODE_EL1h
;
childregs
->
pstate
=
PSR_MODE_EL1h
;
...
...
arch/arm64/kernel/sys.c
浏览文件 @
9ac08002
...
@@ -26,17 +26,6 @@
...
@@ -26,17 +26,6 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/syscalls.h>
#include <linux/syscalls.h>
/*
* Clone a task - this clones the calling program thread.
*/
asmlinkage
long
sys_clone
(
unsigned
long
clone_flags
,
unsigned
long
newsp
,
int
__user
*
parent_tidptr
,
unsigned
long
tls_val
,
int
__user
*
child_tidptr
)
{
return
do_fork
(
clone_flags
,
newsp
,
current_pt_regs
(),
0
,
parent_tidptr
,
child_tidptr
);
}
asmlinkage
long
sys_mmap
(
unsigned
long
addr
,
unsigned
long
len
,
asmlinkage
long
sys_mmap
(
unsigned
long
addr
,
unsigned
long
len
,
unsigned
long
prot
,
unsigned
long
flags
,
unsigned
long
prot
,
unsigned
long
flags
,
unsigned
long
fd
,
off_t
off
)
unsigned
long
fd
,
off_t
off
)
...
...
arch/arm64/kernel/sys_compat.c
浏览文件 @
9ac08002
...
@@ -28,17 +28,6 @@
...
@@ -28,17 +28,6 @@
#include <asm/cacheflush.h>
#include <asm/cacheflush.h>
#include <asm/unistd32.h>
#include <asm/unistd32.h>
asmlinkage
int
compat_sys_fork
(
void
)
{
return
do_fork
(
SIGCHLD
,
0
,
current_pt_regs
(),
0
,
NULL
,
NULL
);
}
asmlinkage
int
compat_sys_vfork
(
void
)
{
return
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
0
,
current_pt_regs
(),
0
,
NULL
,
NULL
);
}
asmlinkage
int
compat_sys_sched_rr_get_interval
(
compat_pid_t
pid
,
asmlinkage
int
compat_sys_sched_rr_get_interval
(
compat_pid_t
pid
,
struct
compat_timespec
__user
*
interval
)
struct
compat_timespec
__user
*
interval
)
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录