• Andy Grover's avatar
    RDS: Copy rds_iovecs into kernel memory instead of rereading from userspace · fc8162e3
    Andy Grover authored
    Change rds_rdma_pages to take a passed-in rds_iovec array instead
    of doing copy_from_user itself.
    
    Change rds_cmsg_rdma_args to copy rds_iovec array once only. This
    eliminates the possibility of userspace changing it after our
    sanity checks.
    
    Implement stack-based storage for small numbers of iovecs, based
    on net/socket.c, to save an alloc in the extremely common case.
    
    Although this patch reduces iovec copies in cmsg_rdma_args to 1,
    we still do another one in rds_rdma_extra_size. Getting rid of
    that one will be trickier, so it'll be a separate patch.
    Signed-off-by: default avatarAndy Grover <andy.grover@oracle.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    fc8162e3
rdma.c 22.4 KB