Received: by 10.213.65.16 with SMTP id m16csp42674imf; Sun, 11 Mar 2018 14:09:51 -0700 (PDT) X-Google-Smtp-Source: AG47ELt6tr7i/8OBCDn16HRTS6Crt5SqEpDBzFD+VCsHvbRY6DydH4zbdLNjKYOCCYDnd9xS7aQf X-Received: by 10.98.58.3 with SMTP id h3mr5726678pfa.178.1520802591845; Sun, 11 Mar 2018 14:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520802591; cv=none; d=google.com; s=arc-20160816; b=b2hHfWN15YIhuDi5n+FwUvI1sesy94tYHxmoqrGdEPbJ6VqtWEtRPj9i2tK4dYfXpg ZKLLrKOMOf5K8SKvwkMPbjLcUvyacqjhry/NyunKOME2JoxZw5NFltnK6A6cTaP+vTLA 94p7OF3Z3ZKGpTICnHZxJDbS/Itd+KtpzDGJuCg1BEyZVCgumDdV3rvrM6qnxkFeH4fW SVLlwiNvanaB3GueRG4Ps8HGOU1q3UPp2T65kx7miSR0MeqIeYQ5bexpSfsO/DKyXZg/ 6xde1ZLLUfdTbE6kt7peQkIiEGt6CYY8LkZrAc0mZ+Z9jhiPFDVAkP97hbejrP35Is/P 020g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=IGB6nkPQgX3yqXCkeD1VdUirwB6pmWYWcRVr3//tO5M=; b=D7UV1kxg+bF8TFT03R9P1q4ZyQ64yQi1RU2n7P9pZXsRmjp34Hv0aVkmyiuq/wZitF QElwOoRQkPvQakeKXnwKmHbFIIEkQtX+TIM4QRV8A4xpDt4TPHdg6v35NE1GvFKa+iRI +6rjRpzxYnVp13SVaF61oChAHUR1q2tBfDaSc6qPkFquZgXqQpybuHO7TMEIHPpG5wTk wUVAiDp6hSQBlU01IwGTVzeLtQmNtLtN7WNWQmHp2NF04sPL95rXvBu36SerKXlAAI4Q aJvcd5e5AuFg9t/Z4HpE+DFo+Bw3eQUrNhiNJENB9sORCVxMi12vpJA0TjfRQPhXGOKF uJQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PdPVoicm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u66si4096686pgc.651.2018.03.11.14.09.37; Sun, 11 Mar 2018 14:09:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PdPVoicm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932459AbeCKVHd (ORCPT + 99 others); Sun, 11 Mar 2018 17:07:33 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34857 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932370AbeCKVHb (ORCPT ); Sun, 11 Mar 2018 17:07:31 -0400 Received: by mail-wr0-f193.google.com with SMTP id n12so2592202wra.2; Sun, 11 Mar 2018 14:07:30 -0700 (PDT) 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=EnjmFu+o5+EcsRSdEgd+66Lar74gnIlXeYxoFz5ptZQN8gbAm8HhgMXMCMYswzQD3r iuaieSSZISloX2Ezx9VGTUAneRspRCRUuLyhbypvdZkd26kM+GTU8FDduCfbL8u3PqM+ aqyrb19KaQUlrJzFh4l0zuEhNHDy53PKhxC3tB/bsDmbH8rdOkaofmFf5J5igcOa8WKp 0CgAXGX4vwz+BGsSqJO3hsHznd7uQ1d2u0WCxE5uJbGLLI58yd7UevfS2exxaYfijwI3 +FmvrzLNLtD7DSIYKNFntVnpvlLzDklo8l03k+JZvePfvaGUjr2HO6BhQamYqOtte5B9 BC3A== X-Gm-Message-State: AElRT7HxE31csFZNuMEWLQ8/uQJm5waqn/UcShAZ4zi1OlV3I6n4GCeR epyllUuYQAGcCZybAVxBOW66cJfkyw4= X-Received: by 10.223.169.229 with SMTP id b92mr4365446wrd.244.1520802450151; Sun, 11 Mar 2018 14:07:30 -0700 (PDT) Received: from localhost ([37.177.59.159]) by smtp.gmail.com with ESMTPSA id h50sm10979845wrf.65.2018.03.11.14.07.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 Mar 2018 14:07:29 -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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 1.9.1