From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752155AbdDEFMO (ORCPT ); Wed, 5 Apr 2017 01:12:14 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:33339 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751096AbdDEFMM (ORCPT ); Wed, 5 Apr 2017 01:12:12 -0400 Date: Tue, 4 Apr 2017 22:12:09 -0700 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: "David S. Miller" , Miklos Szeredi , Al Viro , WANG Cong , Hannes Frederic Sowa , Kees Cook , Vladimir Davydov , Andrey Vagin , netdev@vger.kernel.org Subject: [PATCH] af_unix: Use designated initializers Message-ID: <20170405051209.GA15324@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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