Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
92b6d8ef
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看板
提交
92b6d8ef
编写于
1月 16, 2017
作者:
J
John Johansen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apparmor: allow ns visibility question to consider subnses
Signed-off-by:
N
John Johansen
<
john.johansen@canonical.com
>
上级
31617ddf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
8 deletion
+14
-8
security/apparmor/apparmorfs.c
security/apparmor/apparmorfs.c
+1
-1
security/apparmor/include/policy_ns.h
security/apparmor/include/policy_ns.h
+2
-2
security/apparmor/policy_ns.c
security/apparmor/policy_ns.c
+9
-3
security/apparmor/procattr.c
security/apparmor/procattr.c
+2
-2
未找到文件。
security/apparmor/apparmorfs.c
浏览文件 @
92b6d8ef
...
...
@@ -750,7 +750,7 @@ static int seq_show_profile(struct seq_file *f, void *p)
struct
aa_ns
*
root
=
f
->
private
;
if
(
profile
->
ns
!=
root
)
seq_printf
(
f
,
":%s://"
,
aa_ns_name
(
root
,
profile
->
ns
));
seq_printf
(
f
,
":%s://"
,
aa_ns_name
(
root
,
profile
->
ns
,
true
));
seq_printf
(
f
,
"%s (%s)
\n
"
,
profile
->
base
.
hname
,
aa_profile_mode_names
[
profile
->
mode
]);
...
...
security/apparmor/include/policy_ns.h
浏览文件 @
92b6d8ef
...
...
@@ -74,8 +74,8 @@ extern struct aa_ns *root_ns;
extern
const
char
*
aa_hidden_ns_name
;
bool
aa_ns_visible
(
struct
aa_ns
*
curr
,
struct
aa_ns
*
view
);
const
char
*
aa_ns_name
(
struct
aa_ns
*
parent
,
struct
aa_ns
*
child
);
bool
aa_ns_visible
(
struct
aa_ns
*
curr
,
struct
aa_ns
*
view
,
bool
subns
);
const
char
*
aa_ns_name
(
struct
aa_ns
*
parent
,
struct
aa_ns
*
child
,
bool
subns
);
void
aa_free_ns
(
struct
aa_ns
*
ns
);
int
aa_alloc_root_ns
(
void
);
void
aa_free_root_ns
(
void
);
...
...
security/apparmor/policy_ns.c
浏览文件 @
92b6d8ef
...
...
@@ -33,18 +33,23 @@ const char *aa_hidden_ns_name = "---";
* aa_ns_visible - test if @view is visible from @curr
* @curr: namespace to treat as the parent (NOT NULL)
* @view: namespace to test if visible from @curr (NOT NULL)
* @subns: whether view of a subns is allowed
*
* Returns: true if @view is visible from @curr else false
*/
bool
aa_ns_visible
(
struct
aa_ns
*
curr
,
struct
aa_ns
*
view
)
bool
aa_ns_visible
(
struct
aa_ns
*
curr
,
struct
aa_ns
*
view
,
bool
subns
)
{
if
(
curr
==
view
)
return
true
;
if
(
!
subns
)
return
false
;
for
(
;
view
;
view
=
view
->
parent
)
{
if
(
view
->
parent
==
curr
)
return
true
;
}
return
false
;
}
...
...
@@ -52,16 +57,17 @@ bool aa_ns_visible(struct aa_ns *curr, struct aa_ns *view)
* aa_na_name - Find the ns name to display for @view from @curr
* @curr - current namespace (NOT NULL)
* @view - namespace attempting to view (NOT NULL)
* @subns - are subns visible
*
* Returns: name of @view visible from @curr
*/
const
char
*
aa_ns_name
(
struct
aa_ns
*
curr
,
struct
aa_ns
*
view
)
const
char
*
aa_ns_name
(
struct
aa_ns
*
curr
,
struct
aa_ns
*
view
,
bool
subns
)
{
/* if view == curr then the namespace name isn't displayed */
if
(
curr
==
view
)
return
""
;
if
(
aa_ns_visible
(
curr
,
view
))
{
if
(
aa_ns_visible
(
curr
,
view
,
subns
))
{
/* at this point if a ns is visible it is in a view ns
* thus the curr ns.hname is a prefix of its name.
* Only output the virtualized portion of the name
...
...
security/apparmor/procattr.c
浏览文件 @
92b6d8ef
...
...
@@ -44,10 +44,10 @@ int aa_getprocattr(struct aa_profile *profile, char **string)
struct
aa_ns
*
current_ns
=
__aa_current_profile
()
->
ns
;
char
*
s
;
if
(
!
aa_ns_visible
(
current_ns
,
ns
))
if
(
!
aa_ns_visible
(
current_ns
,
ns
,
true
))
return
-
EACCES
;
ns_name
=
aa_ns_name
(
current_ns
,
ns
);
ns_name
=
aa_ns_name
(
current_ns
,
ns
,
true
);
ns_len
=
strlen
(
ns_name
);
/* if the visible ns_name is > 0 increase size for : :// seperator */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录