Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
e6e8bf41
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
e6e8bf41
编写于
1月 16, 2017
作者:
J
John Johansen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apparmor: fix restricted endian type warnings for dfa unpack
Signed-off-by:
N
John Johansen
<
john.johansen@canonical.com
>
上级
ca4bd5ae
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
12 deletion
+12
-12
security/apparmor/include/match.h
security/apparmor/include/match.h
+3
-3
security/apparmor/match.c
security/apparmor/match.c
+9
-9
未找到文件。
security/apparmor/include/match.h
浏览文件 @
e6e8bf41
...
...
@@ -104,11 +104,11 @@ extern struct aa_dfa *nulldfa;
#define byte_to_byte(X) (X)
#define UNPACK_ARRAY(TABLE, BLOB, LEN, T
YPE, NTOHX)
\
#define UNPACK_ARRAY(TABLE, BLOB, LEN, T
TYPE, BTYPE, NTOHX)
\
do { \
typeof(LEN) __i; \
T
YPE *__t = (
TYPE *) TABLE; \
TYPE *__b = (
TYPE *) BLOB; \
T
TYPE *__t = (T
TYPE *) TABLE; \
BTYPE *__b = (B
TYPE *) BLOB; \
for (__i = 0; __i < LEN; __i++) { \
__t[__i] = NTOHX(__b[__i]); \
} \
...
...
security/apparmor/match.c
浏览文件 @
e6e8bf41
...
...
@@ -73,11 +73,11 @@ static struct table_header *unpack_table(char *blob, size_t bsize)
/* loaded td_id's start at 1, subtract 1 now to avoid doing
* it every time we use td_id as an index
*/
th
.
td_id
=
be16_to_cpu
(
*
(
u
16
*
)
(
blob
))
-
1
;
th
.
td_id
=
be16_to_cpu
(
*
(
__be
16
*
)
(
blob
))
-
1
;
if
(
th
.
td_id
>
YYTD_ID_MAX
)
goto
out
;
th
.
td_flags
=
be16_to_cpu
(
*
(
u
16
*
)
(
blob
+
2
));
th
.
td_lolen
=
be32_to_cpu
(
*
(
u
32
*
)
(
blob
+
8
));
th
.
td_flags
=
be16_to_cpu
(
*
(
__be
16
*
)
(
blob
+
2
));
th
.
td_lolen
=
be32_to_cpu
(
*
(
__be
32
*
)
(
blob
+
8
));
blob
+=
sizeof
(
struct
table_header
);
if
(
!
(
th
.
td_flags
==
YYTD_DATA16
||
th
.
td_flags
==
YYTD_DATA32
||
...
...
@@ -95,13 +95,13 @@ static struct table_header *unpack_table(char *blob, size_t bsize)
table
->
td_lolen
=
th
.
td_lolen
;
if
(
th
.
td_flags
==
YYTD_DATA8
)
UNPACK_ARRAY
(
table
->
td_data
,
blob
,
th
.
td_lolen
,
u8
,
byte_to_byte
);
u8
,
u8
,
byte_to_byte
);
else
if
(
th
.
td_flags
==
YYTD_DATA16
)
UNPACK_ARRAY
(
table
->
td_data
,
blob
,
th
.
td_lolen
,
u16
,
be16_to_cpu
);
u16
,
__be16
,
be16_to_cpu
);
else
if
(
th
.
td_flags
==
YYTD_DATA32
)
UNPACK_ARRAY
(
table
->
td_data
,
blob
,
th
.
td_lolen
,
u32
,
be32_to_cpu
);
u32
,
__be32
,
be32_to_cpu
);
else
goto
fail
;
/* if table was vmalloced make sure the page tables are synced
...
...
@@ -249,14 +249,14 @@ struct aa_dfa *aa_dfa_unpack(void *blob, size_t size, int flags)
if
(
size
<
sizeof
(
struct
table_set_header
))
goto
fail
;
if
(
ntohl
(
*
(
u
32
*
)
data
)
!=
YYTH_MAGIC
)
if
(
ntohl
(
*
(
__be
32
*
)
data
)
!=
YYTH_MAGIC
)
goto
fail
;
hsize
=
ntohl
(
*
(
u
32
*
)
(
data
+
4
));
hsize
=
ntohl
(
*
(
__be
32
*
)
(
data
+
4
));
if
(
size
<
hsize
)
goto
fail
;
dfa
->
flags
=
ntohs
(
*
(
u
16
*
)
(
data
+
12
));
dfa
->
flags
=
ntohs
(
*
(
__be
16
*
)
(
data
+
12
));
data
+=
hsize
;
size
-=
hsize
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录