All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] af_unix: Use designated initializers
@ 2017-04-05  5:12 Kees Cook
  2017-04-06 19:43 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2017-04-05  5:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: David S. Miller, Miklos Szeredi, Al Viro, WANG Cong,
	Hannes Frederic Sowa, Kees Cook, Vladimir Davydov, Andrey Vagin,
	netdev

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] af_unix: Use designated initializers
  2017-04-05  5:12 [PATCH] af_unix: Use designated initializers Kees Cook
@ 2017-04-06 19:43 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-04-06 19:43 UTC (permalink / raw)
  To: keescook
  Cc: linux-kernel, mszeredi, viro, xiyou.wangcong, hannes,
	vdavydov.dev, avagin, netdev

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-06 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05  5:12 [PATCH] af_unix: Use designated initializers Kees Cook
2017-04-06 19:43 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.