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: 9478769 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 EAC8E60827 for ; Sat, 17 Dec 2016 01:00:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC5C6286B0 for ; Sat, 17 Dec 2016 01:00:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF41E2871B; Sat, 17 Dec 2016 01:00:37 +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 57BA22870F for ; Sat, 17 Dec 2016 01:00:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757545AbcLQBAe (ORCPT ); Fri, 16 Dec 2016 20:00:34 -0500 Received: from mail-pf0-f178.google.com ([209.85.192.178]:33019 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755003AbcLQBAd (ORCPT ); Fri, 16 Dec 2016 20:00:33 -0500 Received: by mail-pf0-f178.google.com with SMTP id d2so16386075pfd.0 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=SqXL6p7hcZWKbjraz/BrAZAXwGARLlK/ho4rGAaZRqM9WyIvNCTguoGgfojO64tWR2 Fsa29nKIez2k75tf7k85QyU5rCvGTmfAPiKDk0NB6yXBWajekdy16yOOf8ExeoYVrpXq 1MqtPzi5CKj9FZCJd/ghIvYvUbFA/V0szxGlSNwG6rIu0sh6jUvDUFULP6gzOSVTLWyp p3knqklwRuivGev3wNOvNjevi6OpLLV3voJ+GbW/sG7hTsV2aE7f78wH2G9cm2Jw1Bz8 b9BwLdylOL+sxo6Vr/IRG9fMX3xLrfiJAjX/LE4dNyiEbPANZIJwaK+RWqFroKnqI7is 0LJw== X-Gm-Message-State: AIkVDXJ93cj8Tp52OnhJYgB06/3YOOJuYy5VtDC538flwrIEHtX8mWvt66ZXj+avooYyirqJ 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 Cc: Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil , PoChun Lin , Arnd Bergmann , Julia Lawall , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH] mtk-vcodec: use designated initializers Message-ID: <20161217010031.GA140323@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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/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);