Skip to content

Commit 2c17cd3

Browse files
committed
apparmor: fix restricted endian type warnings for policy unpack
Signed-off-by: John Johansen <john.johansen@canonical.com>
1 parent e6e8bf4 commit 2c17cd3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

security/apparmor/policy_unpack.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ static size_t unpack_u16_chunk(struct aa_ext *e, char **chunk)
151151

152152
if (!inbounds(e, sizeof(u16)))
153153
return 0;
154-
size = le16_to_cpu(get_unaligned((u16 *) e->pos));
155-
e->pos += sizeof(u16);
154+
size = le16_to_cpu(get_unaligned((__le16 *) e->pos));
155+
e->pos += sizeof(__le16);
156156
if (!inbounds(e, size))
157157
return 0;
158158
*chunk = e->pos;
@@ -223,7 +223,7 @@ static bool unpack_u32(struct aa_ext *e, u32 *data, const char *name)
223223
if (!inbounds(e, sizeof(u32)))
224224
return 0;
225225
if (data)
226-
*data = le32_to_cpu(get_unaligned((u32 *) e->pos));
226+
*data = le32_to_cpu(get_unaligned((__le32 *) e->pos));
227227
e->pos += sizeof(u32);
228228
return 1;
229229
}
@@ -236,7 +236,7 @@ static bool unpack_u64(struct aa_ext *e, u64 *data, const char *name)
236236
if (!inbounds(e, sizeof(u64)))
237237
return 0;
238238
if (data)
239-
*data = le64_to_cpu(get_unaligned((u64 *) e->pos));
239+
*data = le64_to_cpu(get_unaligned((__le64 *) e->pos));
240240
e->pos += sizeof(u64);
241241
return 1;
242242
}
@@ -249,7 +249,7 @@ static size_t unpack_array(struct aa_ext *e, const char *name)
249249
int size;
250250
if (!inbounds(e, sizeof(u16)))
251251
return 0;
252-
size = (int)le16_to_cpu(get_unaligned((u16 *) e->pos));
252+
size = (int)le16_to_cpu(get_unaligned((__le16 *) e->pos));
253253
e->pos += sizeof(u16);
254254
return size;
255255
}
@@ -262,7 +262,7 @@ static size_t unpack_blob(struct aa_ext *e, char **blob, const char *name)
262262
u32 size;
263263
if (!inbounds(e, sizeof(u32)))
264264
return 0;
265-
size = le32_to_cpu(get_unaligned((u32 *) e->pos));
265+
size = le32_to_cpu(get_unaligned((__le32 *) e->pos));
266266
e->pos += sizeof(u32);
267267
if (inbounds(e, (size_t) size)) {
268268
*blob = e->pos;

0 commit comments

Comments
 (0)