diff options
author | Kees Cook <keescook@chromium.org> | 2016-12-16 17:04:13 -0800 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2017-01-15 20:00:32 -0800 |
commit | 8486adf0d755062611968ecc1632a13ebce71660 (patch) | |
tree | 8e574a555e2fb2b9b01789607553245b93633c8b /security/apparmor/lsm.c | |
parent | a7f6c1b63b863d29f126d9b163ad5b40008544b2 (diff) | |
download | linux-8486adf0d755062611968ecc1632a13ebce71660.tar.gz linux-8486adf0d755062611968ecc1632a13ebce71660.tar.bz2 linux-8486adf0d755062611968ecc1632a13ebce71660.zip |
apparmor: use designated initializers
Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. These were identified during
allyesconfig builds of x86, arm, and arm64, with most initializer fixes
extracted from grsecurity.
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/lsm.c')
-rw-r--r-- | security/apparmor/lsm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 41b8cb115801..f76738b1eb15 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -176,7 +176,7 @@ static int common_perm_dir_dentry(int op, const struct path *dir, struct dentry *dentry, u32 mask, struct path_cond *cond) { - struct path path = { dir->mnt, dentry }; + struct path path = { .mnt = dir->mnt, .dentry = dentry }; return common_perm(op, &path, mask, cond); } @@ -306,8 +306,10 @@ static int apparmor_path_rename(const struct path *old_dir, struct dentry *old_d profile = aa_current_profile(); if (!unconfined(profile)) { - struct path old_path = { old_dir->mnt, old_dentry }; - struct path new_path = { new_dir->mnt, new_dentry }; + struct path old_path = { .mnt = old_dir->mnt, + .dentry = old_dentry }; + struct path new_path = { .mnt = new_dir->mnt, + .dentry = new_dentry }; struct path_cond cond = { d_backing_inode(old_dentry)->i_uid, d_backing_inode(old_dentry)->i_mode }; |