Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f6a56903
K
Kernel
项目概览
openeuler
/
Kernel
接近 2 年 前同步成功
通知
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看板
提交
f6a56903
编写于
4月 12, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ocfs2: deal with __user misannotations
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
85158410
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
21 deletion
+16
-21
fs/ocfs2/ioctl.c
fs/ocfs2/ioctl.c
+14
-17
fs/ocfs2/move_extents.c
fs/ocfs2/move_extents.c
+2
-4
未找到文件。
fs/ocfs2/ioctl.c
浏览文件 @
f6a56903
...
...
@@ -864,7 +864,7 @@ int ocfs2_info_handle(struct inode *inode, struct ocfs2_info *info,
if
(
status
)
break
;
reqp
=
(
struct
ocfs2_info_request
*
)(
unsigned
long
)
req_addr
;
reqp
=
(
struct
ocfs2_info_request
__user
*
)(
unsigned
long
)
req_addr
;
if
(
!
reqp
)
{
status
=
-
EINVAL
;
goto
bail
;
...
...
@@ -888,9 +888,11 @@ long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
struct
ocfs2_space_resv
sr
;
struct
ocfs2_new_group_input
input
;
struct
reflink_arguments
args
;
const
char
*
old_path
,
*
new_path
;
const
char
__user
*
old_path
;
const
char
__user
*
new_path
;
bool
preserve
;
struct
ocfs2_info
info
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
switch
(
cmd
)
{
case
OCFS2_IOC_GETFLAGS
:
...
...
@@ -937,17 +939,15 @@ long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
return
ocfs2_group_add
(
inode
,
&
input
);
case
OCFS2_IOC_REFLINK
:
if
(
copy_from_user
(
&
args
,
(
struct
reflink_arguments
*
)
arg
,
sizeof
(
args
)))
if
(
copy_from_user
(
&
args
,
argp
,
sizeof
(
args
)))
return
-
EFAULT
;
old_path
=
(
const
char
*
)(
unsigned
long
)
args
.
old_path
;
new_path
=
(
const
char
*
)(
unsigned
long
)
args
.
new_path
;
old_path
=
(
const
char
__user
*
)(
unsigned
long
)
args
.
old_path
;
new_path
=
(
const
char
__user
*
)(
unsigned
long
)
args
.
new_path
;
preserve
=
(
args
.
preserve
!=
0
);
return
ocfs2_reflink_ioctl
(
inode
,
old_path
,
new_path
,
preserve
);
case
OCFS2_IOC_INFO
:
if
(
copy_from_user
(
&
info
,
(
struct
ocfs2_info
__user
*
)
arg
,
sizeof
(
struct
ocfs2_info
)))
if
(
copy_from_user
(
&
info
,
argp
,
sizeof
(
struct
ocfs2_info
)))
return
-
EFAULT
;
return
ocfs2_info_handle
(
inode
,
&
info
,
0
);
...
...
@@ -960,22 +960,20 @@ long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
-
EPERM
;
if
(
copy_from_user
(
&
range
,
(
struct
fstrim_range
*
)
arg
,
sizeof
(
range
)))
if
(
copy_from_user
(
&
range
,
argp
,
sizeof
(
range
)))
return
-
EFAULT
;
ret
=
ocfs2_trim_fs
(
sb
,
&
range
);
if
(
ret
<
0
)
return
ret
;
if
(
copy_to_user
((
struct
fstrim_range
*
)
arg
,
&
range
,
sizeof
(
range
)))
if
(
copy_to_user
(
argp
,
&
range
,
sizeof
(
range
)))
return
-
EFAULT
;
return
0
;
}
case
OCFS2_IOC_MOVE_EXT
:
return
ocfs2_ioctl_move_extents
(
filp
,
(
void
__user
*
)
arg
);
return
ocfs2_ioctl_move_extents
(
filp
,
argp
);
default:
return
-
ENOTTY
;
}
...
...
@@ -988,6 +986,7 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
struct
reflink_arguments
args
;
struct
inode
*
inode
=
file
->
f_path
.
dentry
->
d_inode
;
struct
ocfs2_info
info
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
switch
(
cmd
)
{
case
OCFS2_IOC32_GETFLAGS
:
...
...
@@ -1006,16 +1005,14 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
case
FITRIM
:
break
;
case
OCFS2_IOC_REFLINK
:
if
(
copy_from_user
(
&
args
,
(
struct
reflink_arguments
*
)
arg
,
sizeof
(
args
)))
if
(
copy_from_user
(
&
args
,
argp
,
sizeof
(
args
)))
return
-
EFAULT
;
preserve
=
(
args
.
preserve
!=
0
);
return
ocfs2_reflink_ioctl
(
inode
,
compat_ptr
(
args
.
old_path
),
compat_ptr
(
args
.
new_path
),
preserve
);
case
OCFS2_IOC_INFO
:
if
(
copy_from_user
(
&
info
,
(
struct
ocfs2_info
__user
*
)
arg
,
sizeof
(
struct
ocfs2_info
)))
if
(
copy_from_user
(
&
info
,
argp
,
sizeof
(
struct
ocfs2_info
)))
return
-
EFAULT
;
return
ocfs2_info_handle
(
inode
,
&
info
,
1
);
...
...
fs/ocfs2/move_extents.c
浏览文件 @
f6a56903
...
...
@@ -1082,8 +1082,7 @@ int ocfs2_ioctl_move_extents(struct file *filp, void __user *argp)
context
->
file
=
filp
;
if
(
argp
)
{
if
(
copy_from_user
(
&
range
,
(
struct
ocfs2_move_extents
*
)
argp
,
sizeof
(
range
)))
{
if
(
copy_from_user
(
&
range
,
argp
,
sizeof
(
range
)))
{
status
=
-
EFAULT
;
goto
out
;
}
...
...
@@ -1138,8 +1137,7 @@ int ocfs2_ioctl_move_extents(struct file *filp, void __user *argp)
* length and new_offset even if failure happens somewhere.
*/
if
(
argp
)
{
if
(
copy_to_user
((
struct
ocfs2_move_extents
*
)
argp
,
&
range
,
sizeof
(
range
)))
if
(
copy_to_user
(
argp
,
&
range
,
sizeof
(
range
)))
status
=
-
EFAULT
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录