Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
a46808e1
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a46808e1
编写于
4月 22, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sh: missing checks of __get_user()/__put_user() return values
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
187cd44e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
22 deletion
+27
-22
arch/sh/kernel/signal_32.c
arch/sh/kernel/signal_32.c
+21
-16
arch/sh/kernel/signal_64.c
arch/sh/kernel/signal_64.c
+6
-6
未找到文件。
arch/sh/kernel/signal_32.c
浏览文件 @
a46808e1
...
...
@@ -71,10 +71,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
old_sigset_t
mask
;
if
(
!
access_ok
(
VERIFY_READ
,
act
,
sizeof
(
*
act
))
||
__get_user
(
new_ka
.
sa
.
sa_handler
,
&
act
->
sa_handler
)
||
__get_user
(
new_ka
.
sa
.
sa_restorer
,
&
act
->
sa_restorer
))
__get_user
(
new_ka
.
sa
.
sa_restorer
,
&
act
->
sa_restorer
)
||
__get_user
(
new_ka
.
sa
.
sa_flags
,
&
act
->
sa_flags
)
||
__get_user
(
mask
,
&
act
->
sa_mask
))
return
-
EFAULT
;
__get_user
(
new_ka
.
sa
.
sa_flags
,
&
act
->
sa_flags
);
__get_user
(
mask
,
&
act
->
sa_mask
);
siginitset
(
&
new_ka
.
sa
.
sa_mask
,
mask
);
}
...
...
@@ -83,10 +83,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
if
(
!
ret
&&
oact
)
{
if
(
!
access_ok
(
VERIFY_WRITE
,
oact
,
sizeof
(
*
oact
))
||
__put_user
(
old_ka
.
sa
.
sa_handler
,
&
oact
->
sa_handler
)
||
__put_user
(
old_ka
.
sa
.
sa_restorer
,
&
oact
->
sa_restorer
))
__put_user
(
old_ka
.
sa
.
sa_restorer
,
&
oact
->
sa_restorer
)
||
__put_user
(
old_ka
.
sa
.
sa_flags
,
&
oact
->
sa_flags
)
||
__put_user
(
old_ka
.
sa
.
sa_mask
.
sig
[
0
],
&
oact
->
sa_mask
))
return
-
EFAULT
;
__put_user
(
old_ka
.
sa
.
sa_flags
,
&
oact
->
sa_flags
);
__put_user
(
old_ka
.
sa
.
sa_mask
.
sig
[
0
],
&
oact
->
sa_mask
);
}
return
ret
;
...
...
@@ -150,12 +150,11 @@ static inline int save_sigcontext_fpu(struct sigcontext __user *sc,
if
(
!
(
boot_cpu_data
.
flags
&
CPU_HAS_FPU
))
return
0
;
if
(
!
used_math
())
{
__put_user
(
0
,
&
sc
->
sc_ownedfp
);
return
0
;
}
if
(
!
used_math
())
return
__put_user
(
0
,
&
sc
->
sc_ownedfp
);
__put_user
(
1
,
&
sc
->
sc_ownedfp
);
if
(
__put_user
(
1
,
&
sc
->
sc_ownedfp
))
return
-
EFAULT
;
/* This will cause a "finit" to be triggered by the next
attempted FPU operation by the 'current' process.
...
...
@@ -195,7 +194,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p
regs
->
sr
|=
SR_FD
;
/* Release FPU */
clear_fpu
(
tsk
,
regs
);
clear_used_math
();
__get_user
(
owned_fp
,
&
sc
->
sc_ownedfp
);
err
|=
__get_user
(
owned_fp
,
&
sc
->
sc_ownedfp
);
if
(
owned_fp
)
err
|=
restore_sigcontext_fpu
(
sc
);
}
...
...
@@ -386,11 +385,14 @@ static int setup_frame(int sig, struct k_sigaction *ka,
struct
fdpic_func_descriptor
__user
*
funcptr
=
(
struct
fdpic_func_descriptor
__user
*
)
ka
->
sa
.
sa_handler
;
__get_user
(
regs
->
pc
,
&
funcptr
->
text
);
__get_user
(
regs
->
regs
[
12
],
&
funcptr
->
GOT
);
err
|=
__get_user
(
regs
->
pc
,
&
funcptr
->
text
);
err
|=
__get_user
(
regs
->
regs
[
12
],
&
funcptr
->
GOT
);
}
else
regs
->
pc
=
(
unsigned
long
)
ka
->
sa
.
sa_handler
;
if
(
err
)
goto
give_sigsegv
;
set_fs
(
USER_DS
);
pr_debug
(
"SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx
\n
"
,
...
...
@@ -470,11 +472,14 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
struct
fdpic_func_descriptor
__user
*
funcptr
=
(
struct
fdpic_func_descriptor
__user
*
)
ka
->
sa
.
sa_handler
;
__get_user
(
regs
->
pc
,
&
funcptr
->
text
);
__get_user
(
regs
->
regs
[
12
],
&
funcptr
->
GOT
);
err
|=
__get_user
(
regs
->
pc
,
&
funcptr
->
text
);
err
|=
__get_user
(
regs
->
regs
[
12
],
&
funcptr
->
GOT
);
}
else
regs
->
pc
=
(
unsigned
long
)
ka
->
sa
.
sa_handler
;
if
(
err
)
goto
give_sigsegv
;
set_fs
(
USER_DS
);
pr_debug
(
"SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx
\n
"
,
...
...
arch/sh/kernel/signal_64.c
浏览文件 @
a46808e1
...
...
@@ -173,10 +173,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
old_sigset_t
mask
;
if
(
!
access_ok
(
VERIFY_READ
,
act
,
sizeof
(
*
act
))
||
__get_user
(
new_ka
.
sa
.
sa_handler
,
&
act
->
sa_handler
)
||
__get_user
(
new_ka
.
sa
.
sa_restorer
,
&
act
->
sa_restorer
))
__get_user
(
new_ka
.
sa
.
sa_restorer
,
&
act
->
sa_restorer
)
||
__get_user
(
new_ka
.
sa
.
sa_flags
,
&
act
->
sa_flags
)
||
__get_user
(
mask
,
&
act
->
sa_mask
))
return
-
EFAULT
;
__get_user
(
new_ka
.
sa
.
sa_flags
,
&
act
->
sa_flags
);
__get_user
(
mask
,
&
act
->
sa_mask
);
siginitset
(
&
new_ka
.
sa
.
sa_mask
,
mask
);
}
...
...
@@ -185,10 +185,10 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
if
(
!
ret
&&
oact
)
{
if
(
!
access_ok
(
VERIFY_WRITE
,
oact
,
sizeof
(
*
oact
))
||
__put_user
(
old_ka
.
sa
.
sa_handler
,
&
oact
->
sa_handler
)
||
__put_user
(
old_ka
.
sa
.
sa_restorer
,
&
oact
->
sa_restorer
))
__put_user
(
old_ka
.
sa
.
sa_restorer
,
&
oact
->
sa_restorer
)
||
__put_user
(
old_ka
.
sa
.
sa_flags
,
&
oact
->
sa_flags
)
||
__put_user
(
old_ka
.
sa
.
sa_mask
.
sig
[
0
],
&
oact
->
sa_mask
))
return
-
EFAULT
;
__put_user
(
old_ka
.
sa
.
sa_flags
,
&
oact
->
sa_flags
);
__put_user
(
old_ka
.
sa
.
sa_mask
.
sig
[
0
],
&
oact
->
sa_mask
);
}
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录