projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b2303d7
)
Convert jffs2 acl to struct_size
author
Matthew Wilcox
<
[email protected]
>
Thu, 7 Jun 2018 14:57:19 +0000
(07:57 -0700)
committer
Kees Cook
<
[email protected]
>
Tue, 12 Jun 2018 23:19:22 +0000
(16:19 -0700)
Need to tell the compiler that the acl entries follow the acl header.
Signed-off-by: Matthew Wilcox <
[email protected]
>
Signed-off-by: Kees Cook <
[email protected]
>
fs/jffs2/acl.c
patch
|
blob
|
history
fs/jffs2/acl.h
patch
|
blob
|
history
diff --git
a/fs/jffs2/acl.c
b/fs/jffs2/acl.c
index 7ebacf14837fd8ed1d47d1eec3f753e546de22bc..093ffbd823958e900fbebfafe53cba2de13c7fa0 100644
(file)
--- a/
fs/jffs2/acl.c
+++ b/
fs/jffs2/acl.c
@@
-133,7
+133,8
@@
static void *jffs2_acl_to_medium(const struct posix_acl *acl, size_t *size)
size_t i;
*size = jffs2_acl_size(acl->a_count);
- header = kmalloc(sizeof(*header) + acl->a_count * sizeof(*entry), GFP_KERNEL);
+ header = kmalloc(struct_size(header, a_entries, acl->a_count),
+ GFP_KERNEL);
if (!header)
return ERR_PTR(-ENOMEM);
header->a_version = cpu_to_je32(JFFS2_ACL_VERSION);
diff --git
a/fs/jffs2/acl.h
b/fs/jffs2/acl.h
index 2e2b5745c3b75d42caea23256ccc4bfc6dacb039..12d0271bdde387cf07e7a6a3853b4a7c9d3861f1 100644
(file)
--- a/
fs/jffs2/acl.h
+++ b/
fs/jffs2/acl.h
@@
-22,6
+22,7
@@
struct jffs2_acl_entry_short {
struct jffs2_acl_header {
jint32_t a_version;
+ struct jffs2_acl_entry a_entries[];
};
#ifdef CONFIG_JFFS2_FS_POSIX_ACL