From patchwork Sat Dec 17 01:04:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9478889 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 067A160237 for ; Sat, 17 Dec 2016 05:47:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA2732840E for ; Sat, 17 Dec 2016 05:47:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEE4D2843E; Sat, 17 Dec 2016 05:47:33 +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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7EFA52840E for ; Sat, 17 Dec 2016 05:47:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 645F66E1E9; Sat, 17 Dec 2016 05:47:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x236.google.com (mail-pf0-x236.google.com [IPv6:2607:f8b0:400e:c00::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id 78D3F6E19E for ; Sat, 17 Dec 2016 01:04:44 +0000 (UTC) Received: by mail-pf0-x236.google.com with SMTP id 189so16380220pfz.3 for ; Fri, 16 Dec 2016 17:04:44 -0800 (PST) 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=O8MTMVyHumgVybQ2o8VZhjIcdRiCK38CFyLj0R60mAs=; b=Rfxd2YMSeVy4w5jzobiYjJVlscs4kPVFybBxc2brabUV7tZ9ExBUoFvuMAMjsWR55+ 7xmkl0y4aMSZptuT3dDWp4wzWXZz6OZ0r9E5ctTCuLQl2JhWbmDJWO7TUkbFlsOxfgUa o+lkUAjVcF9iOOmkIgOFDBwXTjf8CY0zK6YIY= 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=O8MTMVyHumgVybQ2o8VZhjIcdRiCK38CFyLj0R60mAs=; b=dGsmUBvwHk0ieR435v7p+agHZeTRSh5e0ocIaY3szd/7llnJxmNk3gz3m6TUMJnE5Z 1AjACickiRR5ruLcJ14cdJANY2IHXPWAHRh+9pyvwDCHc3pMIT8Bj16T5L/qfF7Ooznb segFqLcMf4xcvqHq+eBh4CsXUBIrqfjKm9ufWKKWjhDud+oehUxtPSyzoA5Qh5Bl6C+8 IKnZ3qUqKAuh8RlFDGHZTrVDh51M9Toq58N5YrwHfodf/LBgxu4tB5n49rxlPe5QHaHJ RR9J2mILbBSFYkTORyct+5urAWNDaiRTg6gowR0qciVopQBulaMaOMHlF/g3rHVDWdEN ylJg== X-Gm-Message-State: AKaTC01TpLqyzjB4CORKoOKZMfNHa1g4DtRJWbQLiT1LxT0M97lUe5v0AXCwIVgsaqPiKZ03 X-Received: by 10.84.209.143 with SMTP id y15mr12770855plh.180.1481936683831; Fri, 16 Dec 2016 17:04:43 -0800 (PST) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id q2sm14500024pga.8.2016.12.16.17.04.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Dec 2016 17:04:43 -0800 (PST) Date: Fri, 16 Dec 2016 17:04:42 -0800 From: Kees Cook To: linux-kernel@vger.kernel.org Subject: [PATCH] drm/nouveau: use designated initializers Message-ID: <20161217010442.GA140619@beast> MIME-Version: 1.0 Content-Disposition: inline X-Mailman-Approved-At: Sat, 17 Dec 2016 05:46:01 +0000 Cc: nouveau@lists.freedesktop.org, Ben Skeggs , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. Signed-off-by: Kees Cook --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index a6dbe8258040..ec4668a41e01 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c @@ -107,10 +107,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, } const struct ttm_mem_type_manager_func nouveau_vram_manager = { - nouveau_vram_manager_init, - nouveau_vram_manager_fini, - nouveau_vram_manager_new, - nouveau_vram_manager_del, + .init = nouveau_vram_manager_init, + .takedown = nouveau_vram_manager_fini, + .get_node = nouveau_vram_manager_new, + .put_node = nouveau_vram_manager_del, }; static int @@ -184,11 +184,11 @@ nouveau_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix) } const struct ttm_mem_type_manager_func nouveau_gart_manager = { - nouveau_gart_manager_init, - nouveau_gart_manager_fini, - nouveau_gart_manager_new, - nouveau_gart_manager_del, - nouveau_gart_manager_debug + .init = nouveau_gart_manager_init, + .takedown = nouveau_gart_manager_fini, + .get_node = nouveau_gart_manager_new, + .put_node = nouveau_gart_manager_del, + .debug = nouveau_gart_manager_debug }; /*XXX*/ @@ -257,11 +257,11 @@ nv04_gart_manager_debug(struct ttm_mem_type_manager *man, const char *prefix) } const struct ttm_mem_type_manager_func nv04_gart_manager = { - nv04_gart_manager_init, - nv04_gart_manager_fini, - nv04_gart_manager_new, - nv04_gart_manager_del, - nv04_gart_manager_debug + .init = nv04_gart_manager_init, + .takedown = nv04_gart_manager_fini, + .get_node = nv04_gart_manager_new, + .put_node = nv04_gart_manager_del, + .debug = nv04_gart_manager_debug }; int