• Andrew Morton's avatar
    [PATCH] Fix readv/writev return value · 33f9ef1c
    Andrew Morton authored
    A patch from Janet Morgan <janetmor@us.ibm.com>
    
    If you feed an iovec with a bad address not at the zeroeth segment into
    readv or writev, it returns the wrong value.
    
    	iovec 1:  base is 8050b20 len is 64
    	iovec 2:  base is ffffffff len is 64
    	iovec 3:  base is 8050ba0 len is 64
    
    The writev should return 64 bytes but is returning 128
    
    This is because we've added the new segment's length into `count'
    before running access_ok().
    
    The patch changes it to fix that up on the slow path, if access_ok() fails.
    33f9ef1c
filemap.c 44.8 KB