• Jeff Moyer's avatar
    aio: fix the compat vectored operations · 64857a8e
    Jeff Moyer authored
    commit 9d85cba7 upstream.
    
    The aio compat code was not converting the struct iovecs from 32bit to
    64bit pointers, causing either EINVAL to be returned from io_getevents, or
    EFAULT as the result of the I/O.  This patch passes a compat flag to
    io_submit to signal that pointer conversion is necessary for a given iocb
    array.
    
    A variant of this was tested by Michael Tokarev.  I have also updated the
    libaio test harness to exercise this code path with good success.
    Further, I grabbed a copy of ltp and ran the
    testcases/kernel/syscall/readv and writev tests there (compiled with -m32
    on my 64bit system).  All seems happy, but extra eyes on this would be
    welcome.
    
    [akpm@linux-foundation.org: coding-style fixes]
    [akpm@linux-foundation.org: fix CONFIG_COMPAT=n build]
    Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
    Reported-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
    Cc: Zach Brown <zach.brown@oracle.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    64857a8e
aio.c 46.1 KB