Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1616573 > unrolled thread

[PATCH] af_unix: Use designated initializers

Started byKees Cook <keescook@chromium.org>
First post2017-04-05 07:20 +0200
Last post2017-04-06 21:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] af_unix: Use designated initializers Kees Cook <keescook@chromium.org> - 2017-04-05 07:20 +0200
    Re: [PATCH] af_unix: Use designated initializers David Miller <davem@davemloft.net> - 2017-04-06 21:50 +0200

#1616573 — [PATCH] af_unix: Use designated initializers

FromKees Cook <keescook@chromium.org>
Date2017-04-05 07:20 +0200
Subject[PATCH] af_unix: Use designated initializers
Message-ID<tsLwl-6L2-1@gated-at.bofh.it>
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>
---
 net/unix/af_unix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 928691c43408..6a7fe7660551 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -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)
-- 
2.7.4


-- 
Kees Cook
Pixel Security

[toc] | [next] | [standalone]


#1618310

FromDavid Miller <davem@davemloft.net>
Date2017-04-06 21:50 +0200
Message-ID<ttlzQ-5bW-13@gated-at.bofh.it>
In reply to#1616573
From: Kees Cook <keescook@chromium.org>
Date: Tue, 4 Apr 2017 22:12:09 -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>

Applied to net-next.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web