From patchwork Sat Dec 17 00:59:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9478883 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 02E0D60237 for ; Sat, 17 Dec 2016 05:46:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E74292840E for ; Sat, 17 Dec 2016 05:46:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC21F2843E; Sat, 17 Dec 2016 05:46:40 +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 7AE882840E for ; Sat, 17 Dec 2016 05:46:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F9B16E1B4; Sat, 17 Dec 2016 05:46:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x22c.google.com (mail-pg0-x22c.google.com [IPv6:2607:f8b0:400e:c05::22c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 416876E189 for ; Sat, 17 Dec 2016 00:59:31 +0000 (UTC) Received: by mail-pg0-x22c.google.com with SMTP id 3so37692734pgd.0 for ; Fri, 16 Dec 2016 16:59:31 -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=oZFJe3kmyImViI13hkDfmv/tCwUIsaZ05MqeGWOsLHQ=; b=QlDU6UwXwaO3uUh0vq3ese58wjcvsYK5rirIyraSDuoOTD1asA0fI4Obcv4PyZYIDN 4UMCw4bRjSgnSvMdUU07tcfXGxld7JgtgtOrspHLNS7EJxc9bBUq3QsKDE+sRxpk9FBF id1PN0QgyVeQ5FTzf1zmdcn8Xb9uuEka7l9zE= 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=oZFJe3kmyImViI13hkDfmv/tCwUIsaZ05MqeGWOsLHQ=; b=C9CS+aIO6QgTwkQ5dlHLXWZQJ2vA6QSjaDmiR1Y/soq1XwoKw+JLtGW7OQL90L6YIy GCaAeHMC/Pb5l4Po9jOzK1RSGjJAaorjvIkCPtpR6EZjwAM0trZFSxnWyoxoVSsj5oTc lm2BZ0fvWLPu8i8gJVQxMzNLP/HhSMBd4JS+Rmi/zc6UZkwvgDKEl+tcLDXLiosfB3mA J0ov+fRVBj/Zsr9cprsZKhk5HWsDVkARYtrU6X76KyWXv6XQ9hP0MgRg82fGppRoJfrX 5PphsG/N++V7rZ0N06l35V1d5G5kuEUWKWR08PTir/7gwTIr3EA1gGICXj2HXW/oCex5 PcJw== X-Gm-Message-State: AKaTC03Z4fi9TUHZwzNgp5s0aLJLRVVdVZae4dxj3mRPnaKh6drFN6RU1yFl2vcBFhws/10H X-Received: by 10.84.129.131 with SMTP id b3mr12480834plb.54.1481936370614; Fri, 16 Dec 2016 16:59:30 -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 t129sm7132563pgc.32.2016.12.16.16.59.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Dec 2016 16:59:30 -0800 (PST) Date: Fri, 16 Dec 2016 16:59:29 -0800 From: Kees Cook To: linux-kernel@vger.kernel.org Subject: [PATCH] drm/ttm: use designated initializers Message-ID: <20161217005929.GA140260@beast> MIME-Version: 1.0 Content-Disposition: inline X-Mailman-Approved-At: Sat, 17 Dec 2016 05:46:01 +0000 Cc: Gerd Hoffmann , dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.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/virtio/virtgpu_ttm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c index 4a1de9f81193..63b3d5d35cf6 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c @@ -198,11 +198,11 @@ static void ttm_bo_man_debug(struct ttm_mem_type_manager *man, } static const struct ttm_mem_type_manager_func virtio_gpu_bo_manager_func = { - ttm_bo_man_init, - ttm_bo_man_takedown, - ttm_bo_man_get_node, - ttm_bo_man_put_node, - ttm_bo_man_debug + .init = ttm_bo_man_init, + .takedown = ttm_bo_man_takedown, + .get_node = ttm_bo_man_get_node, + .put_node = ttm_bo_man_put_node, + .debug = ttm_bo_man_debug }; static int virtio_gpu_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,