From patchwork Thu Apr 6 21:18:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9668463 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 9BB19602B3 for ; Thu, 6 Apr 2017 21:20:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7A7C285A1 for ; Thu, 6 Apr 2017 21:20:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBCC3285E7; Thu, 6 Apr 2017 21:20:55 +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 1003B285A1 for ; Thu, 6 Apr 2017 21:20:54 +0000 (UTC) Received: (qmail 32437 invoked by uid 550); 6 Apr 2017 21:19:41 -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 29773 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=/CI64BG4T0dlByCxh3R2MO3fgmK079lvjHO++StgzfI=; b=AaEiJ+ng9t9C6R5CeCI6FyMBE7Ru0fgXkNhjBAXZ03mdeZnmXxnjoSX7WKhrhm4Q6/ vDVStDIU/rj/y9PeA57MmwNs6TcKt7SuNRDtZGo+ihYm2Z3OAgUjC5lb8ErknfZkyegr IW5aVeLoPtvpFNLP5aBOJyj6pA+Mp8Gt3Rz4M= 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=/CI64BG4T0dlByCxh3R2MO3fgmK079lvjHO++StgzfI=; b=Sb2w6s6t32B0YuDUgFdYU9vZ/N6cJYfKwjVUc8Yas/Zuc4dEihgmEwlva0wXEq8hAg VZq09ZwpU+NZCcGASTZZ2s9HSAn7LeH6JEok2zrGt0VwyJNAOcQXg2FrqsrbHL5RZM2y kGgiY0+B0/S4OKS0ip2frWiijOPnGUWUa6wGaLUwQ+MBv1KN+WJv6UV+gX9oR75q8Y+C wZj/fMYBSJ7gqIiNWgKqDkEISw6FNea1UWiG2Rs5Su46MqlmoMUHPYxlS1Lj6hteMoyl d9OBw0Q9AUukRFvRFZhzg//9vKLhrZTA5DiTb2/usHQ171iDGSRfNTtFhPe7eiwAxz+z 5AAg== X-Gm-Message-State: AFeK/H0ZVC/8FPgbB8k2hdxDoOJeH4ba1fjK67VZVn+ECCtk/UzodAB1om78yqLAQrKqhEkY X-Received: by 10.84.175.129 with SMTP id t1mr45175966plb.17.1491513548300; Thu, 06 Apr 2017 14:19:08 -0700 (PDT) From: Kees Cook To: kernel-hardening@lists.openwall.com Cc: Kees Cook , Michael Leibowitz Date: Thu, 6 Apr 2017 14:18:27 -0700 Message-Id: <1491513513-84351-13-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 12/18] ovl: 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, with most initializer fixes extracted from grsecurity. For these cases, terminate the list with { }, which will be zero-filled, instead of undesignated NULLs. Signed-off-by: Kees Cook --- fs/overlayfs/super.c | 4 ++-- fs/overlayfs/util.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index c9e70d39c1ea..07c8793efb1d 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -709,8 +709,8 @@ static const struct xattr_handler *ovl_xattr_handlers[] = { static int ovl_fill_super(struct super_block *sb, void *data, int silent) { - struct path upperpath = { NULL, NULL }; - struct path workpath = { NULL, NULL }; + struct path upperpath = { }; + struct path workpath = { }; struct dentry *root_dentry; struct inode *realinode; struct ovl_entry *oe; diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 6e610a205e15..590fb098f763 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -100,7 +100,7 @@ void ovl_path_lower(struct dentry *dentry, struct path *path) { struct ovl_entry *oe = dentry->d_fsdata; - *path = oe->numlower ? oe->lowerstack[0] : (struct path) { NULL, NULL }; + *path = oe->numlower ? oe->lowerstack[0] : (struct path) { }; } enum ovl_path_type ovl_path_real(struct dentry *dentry, struct path *path)