linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers3@gmail.com>
To: viro@zeniv.linux.org.uk
Cc: bcrl@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-aio@kvack.org, linux-kernel@vger.kernel.org,
	Eric Biggers <ebiggers3@gmail.com>
Subject: [PATCH] aio: Fix type of iterator variable in do_io_submit()
Date: Tue, 22 Apr 2014 17:57:03 -0500	[thread overview]
Message-ID: <1398207423-21119-1-git-send-email-ebiggers3@gmail.com> (raw)

do_io_submit() iterated over the userspace iocb structure pointers using
a variable i of type 'int'.  This was wrong since 'nr', the number of
iocb structure pointers, could potentially be up to LONG_MAX /
sizeof(struct iocb *).  Fix it (and also remove the unnecessary
initialization to 0).

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
---
 fs/aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/aio.c b/fs/aio.c
index 12a3de0e..4c96af7 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1441,7 +1441,7 @@ long do_io_submit(aio_context_t ctx_id, long nr,
 {
 	struct kioctx *ctx;
 	long ret = 0;
-	int i = 0;
+	long i;
 	struct blk_plug plug;
 
 	if (unlikely(nr < 0))
-- 
1.9.2

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>

             reply	other threads:[~2014-04-22 22:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22 22:57 Eric Biggers [this message]
2014-04-23 14:16 ` [PATCH] aio: Fix type of iterator variable in do_io_submit() Matthew Wilcox
2014-04-23 14:42   ` Benjamin LaHaise
2014-04-23 15:24     ` Eric Biggers

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=1398207423-21119-1-git-send-email-ebiggers3@gmail.com \
    --to=ebiggers3@gmail.com \
    --cc=bcrl@kvack.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).