]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ovl: Use designated initializers
authorKees Cook <keescook@chromium.org>
Wed, 29 Mar 2017 21:02:19 +0000 (14:02 -0700)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 20 Apr 2017 14:37:26 +0000 (16:37 +0200)
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.

For these cases, use { }, which will be zero-filled, instead of
undesignated NULLs.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/super.c
fs/overlayfs/util.c

index c9e70d39c1ea1cafd730be5caaea6924a29e7c58..07c8793efb1d237cf65f469fc497c14505310084 100644 (file)
@@ -709,8 +709,8 @@ static const struct xattr_handler *ovl_xattr_handlers[] = {
 
 static int ovl_fill_super(struct super_block *sb, void *data, int silent)
 {
-       struct path upperpath = { NULL, NULL };
-       struct path workpath = { NULL, NULL };
+       struct path upperpath = { };
+       struct path workpath = { };
        struct dentry *root_dentry;
        struct inode *realinode;
        struct ovl_entry *oe;
index 1953986ee6bc221f555f4c53f8129f9c865f91e5..35b8959db5ee00e455d770da3363a4a94b52f8a1 100644 (file)
@@ -101,7 +101,7 @@ void ovl_path_lower(struct dentry *dentry, struct path *path)
 {
        struct ovl_entry *oe = dentry->d_fsdata;
 
-       *path = oe->numlower ? oe->lowerstack[0] : (struct path) { NULL, NULL };
+       *path = oe->numlower ? oe->lowerstack[0] : (struct path) { };
 }
 
 enum ovl_path_type ovl_path_real(struct dentry *dentry, struct path *path)