Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
30b026a8
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
30b026a8
编写于
1月 16, 2017
作者:
J
John Johansen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apparmor: pass gfp_t parameter into profile allocation
Signed-off-by:
N
John Johansen
<
john.johansen@canonical.com
>
上级
73688d1e
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
9 addition
and
8 deletion
+9
-8
security/apparmor/include/policy.h
security/apparmor/include/policy.h
+1
-1
security/apparmor/policy.c
security/apparmor/policy.c
+6
-5
security/apparmor/policy_ns.c
security/apparmor/policy_ns.c
+1
-1
security/apparmor/policy_unpack.c
security/apparmor/policy_unpack.c
+1
-1
未找到文件。
security/apparmor/include/policy.h
浏览文件 @
30b026a8
...
...
@@ -172,7 +172,7 @@ void aa_add_profile(struct aa_policy *common, struct aa_profile *profile);
void
aa_free_proxy_kref
(
struct
kref
*
kref
);
struct
aa_profile
*
aa_alloc_profile
(
const
char
*
name
);
struct
aa_profile
*
aa_alloc_profile
(
const
char
*
name
,
gfp_t
gfp
);
struct
aa_profile
*
aa_new_null_profile
(
struct
aa_profile
*
parent
,
int
hat
);
void
aa_free_profile
(
struct
aa_profile
*
profile
);
void
aa_free_profile_kref
(
struct
kref
*
kref
);
...
...
security/apparmor/policy.c
浏览文件 @
30b026a8
...
...
@@ -255,24 +255,25 @@ void aa_free_profile_kref(struct kref *kref)
/**
* aa_alloc_profile - allocate, initialize and return a new profile
* @hname: name of the profile (NOT NULL)
* @gfp: allocation type
*
* Returns: refcount profile or NULL on failure
*/
struct
aa_profile
*
aa_alloc_profile
(
const
char
*
hname
)
struct
aa_profile
*
aa_alloc_profile
(
const
char
*
hname
,
gfp_t
gfp
)
{
struct
aa_profile
*
profile
;
/* freed by free_profile - usually through aa_put_profile */
profile
=
kzalloc
(
sizeof
(
*
profile
),
GFP_KERNEL
);
profile
=
kzalloc
(
sizeof
(
*
profile
),
gfp
);
if
(
!
profile
)
return
NULL
;
profile
->
proxy
=
kzalloc
(
sizeof
(
struct
aa_proxy
),
GFP_KERNEL
);
profile
->
proxy
=
kzalloc
(
sizeof
(
struct
aa_proxy
),
gfp
);
if
(
!
profile
->
proxy
)
goto
fail
;
kref_init
(
&
profile
->
proxy
->
count
);
if
(
!
aa_policy_init
(
&
profile
->
base
,
NULL
,
hname
,
GFP_KERNEL
))
if
(
!
aa_policy_init
(
&
profile
->
base
,
NULL
,
hname
,
gfp
))
goto
fail
;
kref_init
(
&
profile
->
count
);
...
...
@@ -312,7 +313,7 @@ struct aa_profile *aa_new_null_profile(struct aa_profile *parent, int hat)
goto
fail
;
sprintf
(
name
,
"%s//null-%x"
,
parent
->
base
.
hname
,
uniq
);
profile
=
aa_alloc_profile
(
name
);
profile
=
aa_alloc_profile
(
name
,
GFP_KERNEL
);
kfree
(
name
);
if
(
!
profile
)
goto
fail
;
...
...
security/apparmor/policy_ns.c
浏览文件 @
30b026a8
...
...
@@ -102,7 +102,7 @@ static struct aa_ns *alloc_ns(const char *prefix, const char *name)
mutex_init
(
&
ns
->
lock
);
/* released by aa_free_ns() */
ns
->
unconfined
=
aa_alloc_profile
(
"unconfined"
);
ns
->
unconfined
=
aa_alloc_profile
(
"unconfined"
,
GFP_KERNEL
);
if
(
!
ns
->
unconfined
)
goto
fail_unconfined
;
...
...
security/apparmor/policy_unpack.c
浏览文件 @
30b026a8
...
...
@@ -486,7 +486,7 @@ static struct aa_profile *unpack_profile(struct aa_ext *e)
if
(
!
unpack_str
(
e
,
&
name
,
NULL
))
goto
fail
;
profile
=
aa_alloc_profile
(
name
);
profile
=
aa_alloc_profile
(
name
,
GFP_KERNEL
);
if
(
!
profile
)
return
ERR_PTR
(
-
ENOMEM
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录