From patchwork Sat Dec 17 01:03:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9478793 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 22E2860827 for ; Sat, 17 Dec 2016 01:03:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1398C2866B for ; Sat, 17 Dec 2016 01:03:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 084D0286B0; Sat, 17 Dec 2016 01:03:24 +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 873392866D for ; Sat, 17 Dec 2016 01:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934310AbcLQBDP (ORCPT ); Fri, 16 Dec 2016 20:03:15 -0500 Received: from mail-pg0-f46.google.com ([74.125.83.46]:35210 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935174AbcLQBDL (ORCPT ); Fri, 16 Dec 2016 20:03:11 -0500 Received: by mail-pg0-f46.google.com with SMTP id p66so37714465pga.2 for ; Fri, 16 Dec 2016 17:03:10 -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=JB/7imWK9qvXF59GxKeiUpXFg5iV8yD6NZmfolPsruY=; b=CbUgwjzSvmX5OHN6ZBeN2V2m6qS4z6UEgwDN0vw2eUb79y5+HtcxaA6dNJ5qeIj3n6 A3UV8VoCGv27i9pxdJV8D+Ah3CvOGyA+ysWnPzR97ods6Wnx8IyoTaVSBBm6Ee47UNl9 JemHepNH76yy3HH6XUhhrcI2SeWr9kuF5eL8I= 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=JB/7imWK9qvXF59GxKeiUpXFg5iV8yD6NZmfolPsruY=; b=jmaPp0cPUyvXnz66lke8nwlbYFLu5lseXERd0/+v6uoNUFTeGNyNFr+W152LwHbfcS IH9L9C34/coxO5z8+0NP5Kws2/jeHTR08AwsW74gLw1ptceXCtrqQt2jAaPf3F8j4UuI A2X5VGmkkeIKy+P5swVlzb1b89XIaU2yx3fTHbq1jwxgTEljRu6gZEk2BdNskRJify7e q05B5DYx841D37oMNo2wwKnrF4r9qr5bZ3qTT05E63jpqCe+fxLwjdUTj3ccahWGsD+R 23UbACc8IU48uEd93fjDbYm+fTPnvhvoQDhgOsy7//mHsE1MTApOrHPRl9+tVNfV39xn ATcA== X-Gm-Message-State: AKaTC01CbM1jY2liEHbodIatU4ljwRL+JhZ/VfsCV8KI+X1iD730NAB5lPLrXxf/i7qyof36 X-Received: by 10.99.175.26 with SMTP id w26mr10649066pge.144.1481936590480; Fri, 16 Dec 2016 17:03:10 -0800 (PST) Received: from www.outflux.net ([2002:ada4:7085:0:8454:20a8:3cd7:bcbf]) by smtp.gmail.com with ESMTPSA id p26sm14464126pgn.11.2016.12.16.17.03.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Dec 2016 17:03:10 -0800 (PST) Date: Fri, 16 Dec 2016 17:03:09 -0800 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Tomi Valkeinen , Sudip Mukherjee , linux-fbdev@vger.kernel.org Subject: [PATCH] video: use designated initializers Message-ID: <20161217010309.GA140492@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..5d896f879ff9 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..0273351b2342 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