All of lore.kernel.org
 help / color / mirror / Atom feed
From: Salvatore Mesoraca <s.mesoraca16@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: kernel-hardening@lists.openwall.com, linux-scsi@vger.kernel.org,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Dario Ballabio <ballabio_dario@emc.com>,
	Kees Cook <keescook@chromium.org>,
	Salvatore Mesoraca <s.mesoraca16@gmail.com>
Subject: [PATCH] scsi: eata: drop VLA in reorder()
Date: Sun, 11 Mar 2018 22:06:58 +0100	[thread overview]
Message-ID: <1520802418-17284-1-git-send-email-s.mesoraca16@gmail.com> (raw)

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 <s.mesoraca16@gmail.com>
---
 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

             reply	other threads:[~2018-03-11 21:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-11 21:06 Salvatore Mesoraca [this message]
2018-03-12  3:08 ` [PATCH] scsi: eata: drop VLA in reorder() Tobin C. Harding
2018-03-12  3:08   ` Tobin C. Harding
2018-03-12  6:36   ` valdis.kletnieks
2018-03-12  6:36     ` valdis.kletnieks at vt.edu
2018-03-12  6:36     ` valdis.kletnieks
2018-03-12 10:11   ` Salvatore Mesoraca
2018-03-12 10:11     ` Salvatore Mesoraca
2018-03-12 18:45   ` Linus Torvalds
2018-03-12 18:45     ` Linus Torvalds
2018-03-13  0:44     ` Arthur Marsh
2018-03-13  0:44       ` Arthur Marsh
2018-03-13  0:44       ` Arthur Marsh
2018-03-13  2:35     ` Martin K. Petersen
2018-03-13  2:35       ` Martin K. Petersen
2018-03-13  9:05       ` Christoph Hellwig
2018-03-13  9:05         ` Christoph Hellwig
2018-03-13 22:04         ` Salvatore Mesoraca
2018-03-13 22:04           ` Salvatore Mesoraca
2018-03-13 22:04           ` Salvatore Mesoraca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1520802418-17284-1-git-send-email-s.mesoraca16@gmail.com \
    --to=s.mesoraca16@gmail.com \
    --cc=ballabio_dario@emc.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.