Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c2ec66828fd253802abb912668f4bf9597e3c898
Commit:     c2ec66828fd253802abb912668f4bf9597e3c898
Parent:     7adfa2ff3efa02a7a9f2632d2d2662d3e5eb5304
Author:     Rusty Russell <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 04:20:15 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 09:22:33 2008 -0800

    aio: negative offset should return -EINVAL
    
    An AIO read or write should return -EINVAL if the offset is negative.
    This check matches the one in pread and pwrite.
    
    This was found by the libaio test suite.
    
    Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
    Acked-by: Zach Brown <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/aio.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index 26c1930..b74c567 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1329,6 +1329,10 @@ static ssize_t aio_rw_vect_retry(struct kiocb *iocb)
                opcode = IOCB_CMD_PWRITEV;
        }
 
+       /* This matches the pread()/pwrite() logic */
+       if (iocb->ki_pos < 0)
+               return -EINVAL;
+
        do {
                ret = rw_op(iocb, &iocb->ki_iovec[iocb->ki_cur_seg],
                            iocb->ki_nr_segs - iocb->ki_cur_seg,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to