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: 9478773 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 3A3B460827 for ; Sat, 17 Dec 2016 01:00:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B94F286B0 for ; Sat, 17 Dec 2016 01:00:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 201782871B; Sat, 17 Dec 2016 01:00:58 +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 AE079286B0 for ; Sat, 17 Dec 2016 01:00:57 +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 1cI3Mu-0004f0-NM; Sat, 17 Dec 2016 01:00:56 +0000 Received: from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cI3Mr-0004aj-Pr for linux-mediatek@lists.infradead.org; Sat, 17 Dec 2016 01:00:54 +0000 Received: by mail-pf0-x229.google.com with SMTP id c4so16379912pfb.1 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=UAkH0rGn6HjprtWGsLsohKgfMPCKBZEZ69caSO2NYkbEFWG9e7GjNx2xIRzOPFRiXz TPiUCYUX/H8g3L1DFD6wI6Ek8NwR7NgE7zspJcZCcK1C057vi0E0rxZfcYpYXQijW4Bu EmRPJiMOBnLvsOTq8NV4lKbBFbpNej5SFiAqFpXchIxTE0RoeD+VeeWY6V1mGkWnzFiW TTsp9AKNdHHdQMpvauQ1psYZFnSGP8OD/KavPNYw0z4cfTuLd1UXukSHb/yiZmqnidce JskghoJCAebwCeS87WjtheY5co6RunvgDGTanOWD+CcpG9x+CD+dWu2kLwOJpYxpX4W1 /I4A== X-Gm-Message-State: AIkVDXKsCccYIJqOFHLYU5Pg2xir72wqJqaxasi4r5NvekMQyHsALEbu+zlV0spABWx9CZRZ 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_941958_5A7F4FD0 X-CRM114-Status: GOOD ( 10.10 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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);