From patchwork Sat Dec 17 01:00:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9478787 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 39E2B60827 for ; Sat, 17 Dec 2016 01:02:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B044286B0 for ; Sat, 17 Dec 2016 01:02:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F7BD2871B; Sat, 17 Dec 2016 01:02:30 +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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9ADB52870F for ; Sat, 17 Dec 2016 01:02:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cI3Mw-0004fE-8P; Sat, 17 Dec 2016 01:00:58 +0000 Received: from mail-pf0-x22c.google.com ([2607:f8b0:400e:c00::22c]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cI3Mr-0004ai-Pv for linux-arm-kernel@lists.infradead.org; Sat, 17 Dec 2016 01:00:54 +0000 Received: by mail-pf0-x22c.google.com with SMTP id 189so16368211pfz.3 for ; Fri, 16 Dec 2016 17:00:33 -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=I4c1m/igBHAwvw/Fzgo8epNG9pPBXdMs0aMyuqGrxl4=; b=XV7j6Cj9IZiirfFbHqD65Xjg3cVdLlJzDXjQG8zvkLAGLHSydNmjBQKsgxm4eBTk50 yichpY6hVpMqc2AVLvpDrzUHNL4hSNjqAEFx2HvBXyhZCKjlYlOKzmVV+CBUH3eSMJLY H5FBaLM1dFWt2Gkl7LIqJSZsqpbg7kqyAQQQo= 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=I4c1m/igBHAwvw/Fzgo8epNG9pPBXdMs0aMyuqGrxl4=; b=Jh4zM9ap13CPfqB4NpzU9hv2LZ+znUNoapAbxJWWlW53HwlIO8i1HyG5jAB9DaAMjQ vFa1PTOiVplBAI7JHuTG097ckEVLzH9I2ME243mGvig7epzsfzKNsAfqXoRsVV5mwHdG ynpPc0U4zF+hA7a73CFEon/aohnsKYp2/Bx8/dmL1TVQ1QeMEydYANrbZ+K2jv3wv2n7 P5zOscstOLbpozGRY8ZCp/0+RPTgk9FKFBBNB9wmxEk94gCtlHxxeBL3CHgr7Ss1NWo3 cgEJ4teCpLtSaVbfKelAkLAioRWK0wer74Nrci78OlAIEVPR2VaMyXRHqwB/LtWCxdbV 8rqw== X-Gm-Message-State: AIkVDXITHK/fVOJL4F/uo6FI2nLj3+g+bAScKxD74l739Vnh10D1QRIFfUSrC5oTvaW2/PAI X-Received: by 10.99.116.80 with SMTP id e16mr3953180pgn.135.1481936432557; Fri, 16 Dec 2016 17:00:32 -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 a22sm14396187pfg.7.2016.12.16.17.00.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Dec 2016 17:00:32 -0800 (PST) Date: Fri, 16 Dec 2016 17:00:31 -0800 From: Kees Cook To: linux-kernel@vger.kernel.org Subject: [PATCH] mtk-vcodec: use designated initializers Message-ID: <20161217010031.GA140323@beast> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161216_170053_928722_6B363F5B X-CRM114-Status: GOOD ( 11.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew-CT Chen , Tiffany Lin , Arnd Bergmann , Julia Lawall , Hans Verkuil , linux-arm-kernel@lists.infradead.org, Matthias Brugger , linux-mediatek@lists.infradead.org, Mauro Carvalho Chehab , PoChun Lin , linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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/media/platform/mtk-vcodec/venc/venc_h264_if.c | 8 ++++---- drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c index b76c80bdf30b..4eb3be37ba14 100644 --- a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c +++ b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c @@ -665,10 +665,10 @@ static int h264_enc_deinit(unsigned long handle) } static const struct venc_common_if venc_h264_if = { - h264_enc_init, - h264_enc_encode, - h264_enc_set_param, - h264_enc_deinit, + .init = h264_enc_init, + .encode = h264_enc_encode, + .set_param = h264_enc_set_param, + .deinit = h264_enc_deinit, }; const struct venc_common_if *get_h264_enc_comm_if(void); diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c index 544f57186243..a6fa145f2c54 100644 --- a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c +++ b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c @@ -470,10 +470,10 @@ static int vp8_enc_deinit(unsigned long handle) } static const struct venc_common_if venc_vp8_if = { - vp8_enc_init, - vp8_enc_encode, - vp8_enc_set_param, - vp8_enc_deinit, + .init = vp8_enc_init, + .encode = vp8_enc_encode, + .set_param = vp8_enc_set_param, + .deinit = vp8_enc_deinit, }; const struct venc_common_if *get_vp8_enc_comm_if(void);