]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
af_unix: Use designated initializers
authorKees Cook <keescook@chromium.org>
Wed, 5 Apr 2017 05:12:09 +0000 (22:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Apr 2017 19:43:04 +0000 (12:43 -0700)
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, and the initializer fixes
were extracted from grsecurity. In this case, NULL initialize with { }
instead of undesignated NULLs.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/unix/af_unix.c

index 928691c434087e8ff72b84fc6515539115c0509b..6a7fe7660551f45c065a7f472b805c0b8073f6bb 100644 (file)
@@ -996,7 +996,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
        unsigned int hash;
        struct unix_address *addr;
        struct hlist_head *list;
-       struct path path = { NULL, NULL };
+       struct path path = { };
 
        err = -EINVAL;
        if (sunaddr->sun_family != AF_UNIX)