• Al Viro's avatar
    sanitize iov_iter_fault_in_readable() · 8409a0d2
    Al Viro authored
    1) constify iov_iter argument; we are not advancing it in this primitive.
    
    2) cap the amount requested by the amount of data in iov_iter.  All
    existing callers should've been safe, but the check is really cheap and
    doing it here makes for easier analysis, as well as more consistent
    semantics among the primitives.
    
    3) don't bother with iterate_iovec().  Explicit loop is not any harder
    to follow, and we get rid of standalone iterate_iovec() users - it's
    only used by iterate_and_advance() and (soon to be gone) iterate_all_kinds().
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    8409a0d2
iov_iter.c 49.1 KB