linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] aio: Fix type of iterator variable in do_io_submit()
@ 2014-04-22 22:57 Eric Biggers
  2014-04-23 14:16 ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Biggers @ 2014-04-22 22:57 UTC (permalink / raw)
  To: viro; +Cc: bcrl, linux-fsdevel, linux-aio, linux-kernel, Eric Biggers

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-23 15:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-22 22:57 [PATCH] aio: Fix type of iterator variable in do_io_submit() Eric Biggers
2014-04-23 14:16 ` Matthew Wilcox
2014-04-23 14:42   ` Benjamin LaHaise
2014-04-23 15:24     ` Eric Biggers

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).