From patchwork Wed Apr 5 05:12:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 747096 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vyYr81lDvz9s86 for ; Wed, 5 Apr 2017 15:12:40 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="gmrTVwN1"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751341AbdDEFMN (ORCPT ); Wed, 5 Apr 2017 01:12:13 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:34790 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751040AbdDEFMM (ORCPT ); Wed, 5 Apr 2017 01:12:12 -0400 Received: by mail-pf0-f177.google.com with SMTP id 197so1856633pfv.1 for ; Tue, 04 Apr 2017 22:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=pelOEwd6SqY4zRAiaEXjduLQWxbcL9IalyFLxOGJ1Ho=; b=gmrTVwN1EQb7oDRZ/+4KKeTiTiT9ZHXqAImJY3nwROQk9JfqwjL1IoQlKaCRGJwlsd 0bOgjDo+jMaY4ATuGjSz4+MbwDL6CD+zQFAXB/VtOy0SCVljwIAJJH4zvqnMm3DkzKjg 8SGXxYWuaEIXspAr1pw0l7yi4z9OyVPCni2xI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=pelOEwd6SqY4zRAiaEXjduLQWxbcL9IalyFLxOGJ1Ho=; b=d/6fSimET3hqoWhZ2GW3iANZmZ1R3H0dPbC3s2vl3m0IQUMxAjGZjcAjkb+LWeJ8JU 7vULfocJCKXYs87DiDUkldw7UN9NuE9lnLIKjIlIXaGW81KhwFn6a4DiDCNwX8Yo6MGJ SqqUshefpx4HoDhO9m88mMYm+/VWJ8OHwSe/wGglgUwMC0kulSD/GW8haPIGcGbFUC2S ewMJt2qLqGQWqAjD5BBHDmTmQ6xq2sfPiCK4xFdZjXvxmof+IntIM/aS4HOoqGIoR2Dg +X+iPk8GAPUgDI5qX5mKlVZ+t5ZlII4qsG3y9tomUscxovHERB7zOjkXZvyu8oeZwjxR +ASQ== X-Gm-Message-State: AFeK/H0EDK8Xq4poIBhWdmLd7z4DxomiZhOiVzxn+vwf2KkgSrYEOCK9YVFqJRDXUHn9WXbG X-Received: by 10.98.58.155 with SMTP id v27mr22875674pfj.242.1491369131422; Tue, 04 Apr 2017 22:12:11 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id d3sm19266972pgc.37.2017.04.04.22.12.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 22:12:10 -0700 (PDT) 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-Disposition: inline Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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)