Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
2c17cd36
Commit
2c17cd36
authored
Jan 16, 2017
by
John Johansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apparmor: fix restricted endian type warnings for policy unpack
Signed-off-by:
John Johansen
<
john.johansen@canonical.com
>
parent
e6e8bf41
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
security/apparmor/policy_unpack.c
security/apparmor/policy_unpack.c
+6
-6
No files found.
security/apparmor/policy_unpack.c
View file @
2c17cd36
...
@@ -151,8 +151,8 @@ static size_t unpack_u16_chunk(struct aa_ext *e, char **chunk)
...
@@ -151,8 +151,8 @@ static size_t unpack_u16_chunk(struct aa_ext *e, char **chunk)
if
(
!
inbounds
(
e
,
sizeof
(
u16
)))
if
(
!
inbounds
(
e
,
sizeof
(
u16
)))
return
0
;
return
0
;
size
=
le16_to_cpu
(
get_unaligned
((
u
16
*
)
e
->
pos
));
size
=
le16_to_cpu
(
get_unaligned
((
__le
16
*
)
e
->
pos
));
e
->
pos
+=
sizeof
(
u
16
);
e
->
pos
+=
sizeof
(
__le
16
);
if
(
!
inbounds
(
e
,
size
))
if
(
!
inbounds
(
e
,
size
))
return
0
;
return
0
;
*
chunk
=
e
->
pos
;
*
chunk
=
e
->
pos
;
...
@@ -223,7 +223,7 @@ static bool unpack_u32(struct aa_ext *e, u32 *data, const char *name)
...
@@ -223,7 +223,7 @@ static bool unpack_u32(struct aa_ext *e, u32 *data, const char *name)
if
(
!
inbounds
(
e
,
sizeof
(
u32
)))
if
(
!
inbounds
(
e
,
sizeof
(
u32
)))
return
0
;
return
0
;
if
(
data
)
if
(
data
)
*
data
=
le32_to_cpu
(
get_unaligned
((
u
32
*
)
e
->
pos
));
*
data
=
le32_to_cpu
(
get_unaligned
((
__le
32
*
)
e
->
pos
));
e
->
pos
+=
sizeof
(
u32
);
e
->
pos
+=
sizeof
(
u32
);
return
1
;
return
1
;
}
}
...
@@ -236,7 +236,7 @@ static bool unpack_u64(struct aa_ext *e, u64 *data, const char *name)
...
@@ -236,7 +236,7 @@ static bool unpack_u64(struct aa_ext *e, u64 *data, const char *name)
if
(
!
inbounds
(
e
,
sizeof
(
u64
)))
if
(
!
inbounds
(
e
,
sizeof
(
u64
)))
return
0
;
return
0
;
if
(
data
)
if
(
data
)
*
data
=
le64_to_cpu
(
get_unaligned
((
u
64
*
)
e
->
pos
));
*
data
=
le64_to_cpu
(
get_unaligned
((
__le
64
*
)
e
->
pos
));
e
->
pos
+=
sizeof
(
u64
);
e
->
pos
+=
sizeof
(
u64
);
return
1
;
return
1
;
}
}
...
@@ -249,7 +249,7 @@ static size_t unpack_array(struct aa_ext *e, const char *name)
...
@@ -249,7 +249,7 @@ static size_t unpack_array(struct aa_ext *e, const char *name)
int
size
;
int
size
;
if
(
!
inbounds
(
e
,
sizeof
(
u16
)))
if
(
!
inbounds
(
e
,
sizeof
(
u16
)))
return
0
;
return
0
;
size
=
(
int
)
le16_to_cpu
(
get_unaligned
((
u
16
*
)
e
->
pos
));
size
=
(
int
)
le16_to_cpu
(
get_unaligned
((
__le
16
*
)
e
->
pos
));
e
->
pos
+=
sizeof
(
u16
);
e
->
pos
+=
sizeof
(
u16
);
return
size
;
return
size
;
}
}
...
@@ -262,7 +262,7 @@ static size_t unpack_blob(struct aa_ext *e, char **blob, const char *name)
...
@@ -262,7 +262,7 @@ static size_t unpack_blob(struct aa_ext *e, char **blob, const char *name)
u32
size
;
u32
size
;
if
(
!
inbounds
(
e
,
sizeof
(
u32
)))
if
(
!
inbounds
(
e
,
sizeof
(
u32
)))
return
0
;
return
0
;
size
=
le32_to_cpu
(
get_unaligned
((
u
32
*
)
e
->
pos
));
size
=
le32_to_cpu
(
get_unaligned
((
__le
32
*
)
e
->
pos
));
e
->
pos
+=
sizeof
(
u32
);
e
->
pos
+=
sizeof
(
u32
);
if
(
inbounds
(
e
,
(
size_t
)
size
))
{
if
(
inbounds
(
e
,
(
size_t
)
size
))
{
*
blob
=
e
->
pos
;
*
blob
=
e
->
pos
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment