From patchwork Tue Jan 3 23:24:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9495907 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 AFB9760413 for ; Tue, 3 Jan 2017 23:27:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2B7527CFC for ; Tue, 3 Jan 2017 23:27:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9786A27D16; Tue, 3 Jan 2017 23:27:02 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FF9F27CFC for ; Tue, 3 Jan 2017 23:27:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759480AbdACXZM (ORCPT ); Tue, 3 Jan 2017 18:25:12 -0500 Received: from mail-pg0-f47.google.com ([74.125.83.47]:34178 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753092AbdACXYe (ORCPT ); Tue, 3 Jan 2017 18:24:34 -0500 Received: by mail-pg0-f47.google.com with SMTP id y62so167673143pgy.1 for ; Tue, 03 Jan 2017 15:24:34 -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=5NOIU+2sIjCUgcv1gC8PS/MpHEUXArzz/j01UvTwYD4=; b=Rb6wfWgmkDJ2g0jTYUR7WPMEevTgcYMXCU/lQVDl8ZsxuvPGt3fGG4sxgDbYO4EI2j PG+fu8S4csN6BNhcV4qvE8XQK4pj14QGoaf/sYqUHp9VYT/R7AsRBygDiqIP+an4Snjq G1WhcJ5BQtQdU7ZJeI1wserrn4XHlx7QWcLLg= 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=5NOIU+2sIjCUgcv1gC8PS/MpHEUXArzz/j01UvTwYD4=; b=tUJxcFRAFpNY+9zD4WJEDYl+Hpl+qRFx7ONr93Chtrjf+Cdz3DgEgyjkpphXDn8A60 vt7px+zZI0elaXL+EKPt8+pLhWoLk7sVaPe3Mulyi8r/wK2Ett7UWSsMm+MHvPx0oHcd 9FQ+xzCDYBg7PcFnTX3OhClNPFyD2BwB4bgVqtvBLJaKP+EUwjAlsnHpOW8UaZlGPmXr 5jmiy1YLKv4f62TN39ybUGG2DNNVT/0ezysmXyPAT1g7NX4+VkPGucMJ/Jk9tgAp2sE5 SMw7XTzLmM54B6301f9A5erokOLI/URPTAIwid5hZ+nqkM/TfnnalWn+mJe4yCXmvAdw Kx2w== X-Gm-Message-State: AIkVDXJ9HQ7sMxhfUkeypJ00YKb7j6JE5z70+GocqpHzN2SQByHHxXbRDfj+atmsYAdsJVSH X-Received: by 10.84.238.15 with SMTP id u15mr48006996plk.8.1483485874186; Tue, 03 Jan 2017 15:24:34 -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 k192sm124102158pgc.3.2017.01.03.15.24.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2017 15:24:33 -0800 (PST) Date: Tue, 3 Jan 2017 15:24:33 -0800 From: Kees Cook To: Bartlomiej Zolnierkiewicz Cc: Sudip Mukherjee , Tomi Valkeinen , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] video: fbdev: matroxfb: use designated initializers Message-ID: <20170103232433.GA117659@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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/video/fbdev/matrox/matroxfb_DAC1064.c | 10 ++++++++-- drivers/video/fbdev/matrox/matroxfb_Ti3026.c | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c index a01147fdf270..b380a393cbc3 100644 --- a/drivers/video/fbdev/matrox/matroxfb_DAC1064.c +++ b/drivers/video/fbdev/matrox/matroxfb_DAC1064.c @@ -1088,14 +1088,20 @@ static void MGAG100_restore(struct matrox_fb_info *minfo) #ifdef CONFIG_FB_MATROX_MYSTIQUE struct matrox_switch matrox_mystique = { - MGA1064_preinit, MGA1064_reset, MGA1064_init, MGA1064_restore, + .preinit = MGA1064_preinit, + .reset = MGA1064_reset, + .init = MGA1064_init, + .restore = MGA1064_restore, }; EXPORT_SYMBOL(matrox_mystique); #endif #ifdef CONFIG_FB_MATROX_G struct matrox_switch matrox_G100 = { - MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore, + .preinit = MGAG100_preinit, + .reset = MGAG100_reset, + .init = MGAG100_init, + .restore = MGAG100_restore, }; EXPORT_SYMBOL(matrox_G100); #endif diff --git a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c index 68fa037d8cbc..9ff9be85759e 100644 --- a/drivers/video/fbdev/matrox/matroxfb_Ti3026.c +++ b/drivers/video/fbdev/matrox/matroxfb_Ti3026.c @@ -738,7 +738,10 @@ static int Ti3026_preinit(struct matrox_fb_info *minfo) } struct matrox_switch matrox_millennium = { - Ti3026_preinit, Ti3026_reset, Ti3026_init, Ti3026_restore + .preinit = Ti3026_preinit, + .reset = Ti3026_reset, + .init = Ti3026_init, + .restore = Ti3026_restore }; EXPORT_SYMBOL(matrox_millennium); #endif