From patchwork Thu Apr 6 21:18:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9668461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6D957602B3 for ; Thu, 6 Apr 2017 21:20:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9EE7285A1 for ; Thu, 6 Apr 2017 21:20:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9ECEC285E7; Thu, 6 Apr 2017 21:20:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id B9145285A1 for ; Thu, 6 Apr 2017 21:20:47 +0000 (UTC) Received: (qmail 32299 invoked by uid 550); 6 Apr 2017 21:19:39 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 29802 invoked from network); 6 Apr 2017 21:19:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eaQLHWNv9nDsVHR57Zk9LCRBUKtWUfN23bHK66M7xFs=; b=ainQQ1CFd4js3cFoCO0xff3vDcLrtmFApmEcJv03Gv0QM0qdZwqpKsBA6c71AWCafs 9CQULviHhV0DAQCyeTSvromz7BUWswMHBBGFli7murkLMRsf0qGrvYqHDuKfJQyM0pIM IwizTMgnAuwhFXsLhoo9lcbc5KtqQWGVHdon0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eaQLHWNv9nDsVHR57Zk9LCRBUKtWUfN23bHK66M7xFs=; b=hevxsFfJADOyNhNcY3vJMtQWa1Ok0bNXwhVOT5zJ1/nqGa3qPbyzblQtL/9CRvzkRn EWN5FnDxignlczLIp21wrgRTtVRZN573vAIizcHP9ExDerYXh++GYeA4V7lD5amO6q9A 9QnznYrEuyJlKqHk+0QyhqpJCUoOycGlqMmso90ytG7CXa435xoHan+fcD7QwsSfos0j Y8f3SqnVdv7w1SRLsyfsKztOXhYND7SQ45bKWuhXHNipPN7go5XareIcM3SZ180vMtci 2a8zTHZ/UOXoT5DhgbyxMvu/+En4epHUykxn96um1rUsHxNKYvd7917ztJnKJ4BjhUKu AXIA== X-Gm-Message-State: AFeK/H3v7vGkjsrApHEWfkkweR0z5KSOGDpbMYMIzou7BawBwxwlx/ps7iw0MzG3yjEb3Ayq X-Received: by 10.99.127.12 with SMTP id a12mr38098264pgd.5.1491513549075; Thu, 06 Apr 2017 14:19:09 -0700 (PDT) From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , Michael Leibowitz Date: Thu, 6 Apr 2017 14:18:20 -0700 Message-Id: <1491513513-84351-6-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491513513-84351-1-git-send-email-keescook@chromium.org> References: <1491513513-84351-1-git-send-email-keescook@chromium.org> Subject: [kernel-hardening] [PATCH 05/18] af_unix: Use designated initializers X-Virus-Scanned: ClamAV using ClamSMTP 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)