af_unix: Use designated initializers
Subsystems (3)
PATCH 1/1 af_unix: 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, and the initializer fixes were extracted from grsecurity. In this case, NULL initialize with { } instead of undesignated NULLs.
--- net/unix/af_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/af_unix.c +1 -1
@@ -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 )
Signature · 6 lines
2.7.4 -- Kees Cook Pixel Security
From: Kees Cook <[email protected]>
Date: Tue, 4 Apr 2017 22:12:09 -0700
Quoted 7 lines
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 <[email protected]>
Applied to net-next.