Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
cdcf116d
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cdcf116d
编写于
12月 08, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch security_path_chmod() to struct path *
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
d8c9584e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
25 deletion
+15
-25
fs/open.c
fs/open.c
+1
-1
include/linux/security.h
include/linux/security.h
+3
-7
security/apparmor/lsm.c
security/apparmor/lsm.c
+3
-4
security/capability.c
security/capability.c
+1
-2
security/security.c
security/security.c
+3
-4
security/tomoyo/tomoyo.c
security/tomoyo/tomoyo.c
+4
-7
未找到文件。
fs/open.c
浏览文件 @
cdcf116d
...
...
@@ -456,7 +456,7 @@ static int chmod_common(struct path *path, umode_t mode)
if
(
error
)
return
error
;
mutex_lock
(
&
inode
->
i_mutex
);
error
=
security_path_chmod
(
path
->
dentry
,
path
->
mnt
,
mode
);
error
=
security_path_chmod
(
path
,
mode
);
if
(
error
)
goto
out_unlock
;
newattrs
.
ia_mode
=
(
mode
&
S_IALLUGO
)
|
(
inode
->
i_mode
&
~
S_IALLUGO
);
...
...
include/linux/security.h
浏览文件 @
cdcf116d
...
...
@@ -1435,8 +1435,7 @@ struct security_operations {
struct
dentry
*
new_dentry
);
int
(
*
path_rename
)
(
struct
path
*
old_dir
,
struct
dentry
*
old_dentry
,
struct
path
*
new_dir
,
struct
dentry
*
new_dentry
);
int
(
*
path_chmod
)
(
struct
dentry
*
dentry
,
struct
vfsmount
*
mnt
,
umode_t
mode
);
int
(
*
path_chmod
)
(
struct
path
*
path
,
umode_t
mode
);
int
(
*
path_chown
)
(
struct
path
*
path
,
uid_t
uid
,
gid_t
gid
);
int
(
*
path_chroot
)
(
struct
path
*
path
);
#endif
...
...
@@ -2866,8 +2865,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
struct
dentry
*
new_dentry
);
int
security_path_rename
(
struct
path
*
old_dir
,
struct
dentry
*
old_dentry
,
struct
path
*
new_dir
,
struct
dentry
*
new_dentry
);
int
security_path_chmod
(
struct
dentry
*
dentry
,
struct
vfsmount
*
mnt
,
umode_t
mode
);
int
security_path_chmod
(
struct
path
*
path
,
umode_t
mode
);
int
security_path_chown
(
struct
path
*
path
,
uid_t
uid
,
gid_t
gid
);
int
security_path_chroot
(
struct
path
*
path
);
#else
/* CONFIG_SECURITY_PATH */
...
...
@@ -2919,9 +2917,7 @@ static inline int security_path_rename(struct path *old_dir,
return
0
;
}
static
inline
int
security_path_chmod
(
struct
dentry
*
dentry
,
struct
vfsmount
*
mnt
,
umode_t
mode
)
static
inline
int
security_path_chmod
(
struct
path
*
path
,
umode_t
mode
)
{
return
0
;
}
...
...
security/apparmor/lsm.c
浏览文件 @
cdcf116d
...
...
@@ -344,13 +344,12 @@ static int apparmor_path_rename(struct path *old_dir, struct dentry *old_dentry,
return
error
;
}
static
int
apparmor_path_chmod
(
struct
dentry
*
dentry
,
struct
vfsmount
*
mnt
,
umode_t
mode
)
static
int
apparmor_path_chmod
(
struct
path
*
path
,
umode_t
mode
)
{
if
(
!
mediated_filesystem
(
dentry
->
d_inode
))
if
(
!
mediated_filesystem
(
path
->
dentry
->
d_inode
))
return
0
;
return
common_perm_mnt_dentry
(
OP_CHMOD
,
mnt
,
dentry
,
AA_MAY_CHMOD
);
return
common_perm_mnt_dentry
(
OP_CHMOD
,
path
->
mnt
,
path
->
dentry
,
AA_MAY_CHMOD
);
}
static
int
apparmor_path_chown
(
struct
path
*
path
,
uid_t
uid
,
gid_t
gid
)
...
...
security/capability.c
浏览文件 @
cdcf116d
...
...
@@ -279,8 +279,7 @@ static int cap_path_truncate(struct path *path)
return
0
;
}
static
int
cap_path_chmod
(
struct
dentry
*
dentry
,
struct
vfsmount
*
mnt
,
umode_t
mode
)
static
int
cap_path_chmod
(
struct
path
*
path
,
umode_t
mode
)
{
return
0
;
}
...
...
security/security.c
浏览文件 @
cdcf116d
...
...
@@ -454,12 +454,11 @@ int security_path_truncate(struct path *path)
return
security_ops
->
path_truncate
(
path
);
}
int
security_path_chmod
(
struct
dentry
*
dentry
,
struct
vfsmount
*
mnt
,
umode_t
mode
)
int
security_path_chmod
(
struct
path
*
path
,
umode_t
mode
)
{
if
(
unlikely
(
IS_PRIVATE
(
dentry
->
d_inode
)))
if
(
unlikely
(
IS_PRIVATE
(
path
->
dentry
->
d_inode
)))
return
0
;
return
security_ops
->
path_chmod
(
dentry
,
mnt
,
mode
);
return
security_ops
->
path_chmod
(
path
,
mode
);
}
int
security_path_chown
(
struct
path
*
path
,
uid_t
uid
,
gid_t
gid
)
...
...
security/tomoyo/tomoyo.c
浏览文件 @
cdcf116d
...
...
@@ -353,17 +353,14 @@ static int tomoyo_file_ioctl(struct file *file, unsigned int cmd,
/**
* tomoyo_path_chmod - Target for security_path_chmod().
*
* @dentry: Pointer to "struct dentry".
* @mnt: Pointer to "struct vfsmount".
* @mode: DAC permission mode.
* @path: Pointer to "struct path".
* @mode: DAC permission mode.
*
* Returns 0 on success, negative value otherwise.
*/
static
int
tomoyo_path_chmod
(
struct
dentry
*
dentry
,
struct
vfsmount
*
mnt
,
umode_t
mode
)
static
int
tomoyo_path_chmod
(
struct
path
*
path
,
umode_t
mode
)
{
struct
path
path
=
{
mnt
,
dentry
};
return
tomoyo_path_number_perm
(
TOMOYO_TYPE_CHMOD
,
&
path
,
return
tomoyo_path_number_perm
(
TOMOYO_TYPE_CHMOD
,
path
,
mode
&
S_IALLUGO
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录