From patchwork Sun Mar 11 21:06:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salvatore Mesoraca X-Patchwork-Id: 10274935 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 07860602BD for ; Sun, 11 Mar 2018 21:07:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED88A27FAC for ; Sun, 11 Mar 2018 21:07:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E14B928178; Sun, 11 Mar 2018 21:07:44 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 2924D27FAC for ; Sun, 11 Mar 2018 21:07:43 +0000 (UTC) Received: (qmail 4085 invoked by uid 550); 11 Mar 2018 21:07:42 -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 4043 invoked from network); 11 Mar 2018 21:07:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=IGB6nkPQgX3yqXCkeD1VdUirwB6pmWYWcRVr3//tO5M=; b=PdPVoicmHKQac4/dXl+ievQFacBH7j8mSZ39iOfnP61zPSlNauweUshskmCGlCPy2l T55s1bbjajbIclISOGv0wfdJyS3f0Ko6yN3vaV0jDJNkReYO6b7+aDO+YJ8AnfIbv6DS Pr3W692vYoraJUHkVfMHiRQAcflPs3P79yA6MmO1awwRegXReEDW6T4u4jfGZMVM1LqO Ep0VHR/jqaMHW3ybyIq+OGUx86IQnHXJIL9t/hEtfjnuIMR+O42j6wY9yPzd16YdUTJy JWuvbbClAocKgYwmRUYm077JsVGrBJoNwm/cjBwR7ag3TrX0EqM77KeMGHomhRuD/C4d ceog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IGB6nkPQgX3yqXCkeD1VdUirwB6pmWYWcRVr3//tO5M=; b=rkDm4mQT5xWKyzsownbAmbt19Brqjnh2jofsGqsisuUEirJrFp4JNETOP1bGdnLKjU dZMv3b8mEJ5cRV+42mV+Hb28xHzNISgjqG2GHPwiWgd+tIySz6zPPrgIqj28D44PpbT9 H/zillWLnqQVGpYWPCWHs2WHmMiEcJPORfzV7RLnQSe3rrQRpnbC5DVnbCktLP2/Lev3 r+B7D6x0NMfnfNaYLWcbr2ZO7NHvO9m14M+nC7P+/bOKU5rPZL1zEenDhUknpu9qD20X ofAdOh/SySDB4SqXsmr3Xne2ALfGUWejz++Gf9qQ3rthf7BmB9U1NK7e1tNvjl+v6r10 tdWg== X-Gm-Message-State: AElRT7F361G9v+znEMStUWocpvCpadcUimAEMhGnf4Af0nEaXBbCP253 G/wS/xmT4EqFXdnH0FeJD4c= X-Google-Smtp-Source: AG47ELvtJPk7Ahnf4cSDU7IDFFtUe4Q9JchZ69nj4qsNPoUMfIMCGgA0b0SrcPq+pt0TcOA6dvP5vg== X-Received: by 10.223.169.229 with SMTP id b92mr4365446wrd.244.1520802450151; Sun, 11 Mar 2018 14:07:30 -0700 (PDT) From: Salvatore Mesoraca To: linux-kernel@vger.kernel.org Cc: kernel-hardening@lists.openwall.com, linux-scsi@vger.kernel.org, "James E.J. Bottomley" , "Martin K. Petersen" , Dario Ballabio , Kees Cook , Salvatore Mesoraca Subject: [PATCH] scsi: eata: drop VLA in reorder() Date: Sun, 11 Mar 2018 22:06:58 +0100 Message-Id: <1520802418-17284-1-git-send-email-s.mesoraca16@gmail.com> X-Mailer: git-send-email 1.9.1 X-Virus-Scanned: ClamAV using ClamSMTP n_ready will always be less than or equal to MAX_MAILBOXES. So we avoid a VLA[1] and use fixed-length arrays instead. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Salvatore Mesoraca --- drivers/scsi/eata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c index 6501c33..202cd17 100644 --- a/drivers/scsi/eata.c +++ b/drivers/scsi/eata.c @@ -2096,7 +2096,7 @@ static int reorder(struct hostdata *ha, unsigned long cursec, unsigned int k, n; unsigned int rev = 0, s = 1, r = 1; unsigned int input_only = 1, overlap = 0; - unsigned long sl[n_ready], pl[n_ready], ll[n_ready]; + unsigned long sl[MAX_MAILBOXES], pl[MAX_MAILBOXES], ll[MAX_MAILBOXES]; unsigned long maxsec = 0, minsec = ULONG_MAX, seek = 0, iseek = 0; unsigned long ioseek = 0;