From patchwork Thu Mar 8 17:39:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 10268593 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 18BB96016D for ; Thu, 8 Mar 2018 17:40:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08A912997C for ; Thu, 8 Mar 2018 17:40:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0A3729980; Thu, 8 Mar 2018 17:40:11 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id E5E2E2997C for ; Thu, 8 Mar 2018 17:40:10 +0000 (UTC) Received: (qmail 1941 invoked by uid 550); 8 Mar 2018 17:40:08 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 1900 invoked from network); 8 Mar 2018 17:40:07 -0000 Date: Thu, 8 Mar 2018 11:39:49 -0600 From: "Gustavo A. R. Silva" To: Emil Velikov , Florian Tobias Schandinat , Bartlomiej Zolnierkiewicz Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Kees Cook , "Gustavo A. R. Silva" Subject: [PATCH] video: fbdev: via: remove VLA usage Message-ID: <20180308173949.GA19305@embeddedgus> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - lists.openwall.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.175.117.58 X-Source-L: No X-Exim-ID: 1etzW9-002E5U-Hn X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.175.117.58]:58548 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 30 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes X-Virus-Scanned: ClamAV using ClamSMTP In preparation to enabling -Wvla, remove VLA usage. Also, fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Eric Engestrom Reviewed-by: Emil Velikov --- drivers/video/fbdev/via/via_aux_sii164.c | 2 +- drivers/video/fbdev/via/via_aux_vt1631.c | 2 +- drivers/video/fbdev/via/via_aux_vt1632.c | 2 +- drivers/video/fbdev/via/via_aux_vt1636.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/via/via_aux_sii164.c b/drivers/video/fbdev/via/via_aux_sii164.c index ca1b35f..c27f62c 100644 --- a/drivers/video/fbdev/via/via_aux_sii164.c +++ b/drivers/video/fbdev/via/via_aux_sii164.c @@ -36,7 +36,7 @@ static void probe(struct via_aux_bus *bus, u8 addr) .name = name}; /* check vendor id and device id */ const u8 id[] = {0x01, 0x00, 0x06, 0x00}, len = ARRAY_SIZE(id); - u8 tmp[len]; + u8 tmp[ARRAY_SIZE(id)]; if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) return; diff --git a/drivers/video/fbdev/via/via_aux_vt1631.c b/drivers/video/fbdev/via/via_aux_vt1631.c index 06e742f..32978a0 100644 --- a/drivers/video/fbdev/via/via_aux_vt1631.c +++ b/drivers/video/fbdev/via/via_aux_vt1631.c @@ -36,7 +36,7 @@ void via_aux_vt1631_probe(struct via_aux_bus *bus) .name = name}; /* check vendor id and device id */ const u8 id[] = {0x06, 0x11, 0x91, 0x31}, len = ARRAY_SIZE(id); - u8 tmp[len]; + u8 tmp[ARRAY_SIZE(id)]; if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) return; diff --git a/drivers/video/fbdev/via/via_aux_vt1632.c b/drivers/video/fbdev/via/via_aux_vt1632.c index d24f4cd..cec8cc4 100644 --- a/drivers/video/fbdev/via/via_aux_vt1632.c +++ b/drivers/video/fbdev/via/via_aux_vt1632.c @@ -36,7 +36,7 @@ static void probe(struct via_aux_bus *bus, u8 addr) .name = name}; /* check vendor id and device id */ const u8 id[] = {0x06, 0x11, 0x92, 0x31}, len = ARRAY_SIZE(id); - u8 tmp[len]; + u8 tmp[ARRAY_SIZE(id)]; if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) return; diff --git a/drivers/video/fbdev/via/via_aux_vt1636.c b/drivers/video/fbdev/via/via_aux_vt1636.c index 9e015c1..2b10bc2 100644 --- a/drivers/video/fbdev/via/via_aux_vt1636.c +++ b/drivers/video/fbdev/via/via_aux_vt1636.c @@ -36,7 +36,7 @@ void via_aux_vt1636_probe(struct via_aux_bus *bus) .name = name}; /* check vendor id and device id */ const u8 id[] = {0x06, 0x11, 0x45, 0x33}, len = ARRAY_SIZE(id); - u8 tmp[len]; + u8 tmp[ARRAY_SIZE(id)]; if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len)) return;