Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'fix-uio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull copy*_iter fix from Al Viro.

[ Al used entirely the wrong return value. Oopsie. ]

* 'fix-uio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
fix brown paperbag bug in inlined copy_..._iter()

+4 -4
+4 -4
include/linux/uio.h
··· 103 103 size_t copy_to_iter(const void *addr, size_t bytes, struct iov_iter *i) 104 104 { 105 105 if (unlikely(!check_copy_size(addr, bytes, true))) 106 - return bytes; 106 + return 0; 107 107 else 108 108 return _copy_to_iter(addr, bytes, i); 109 109 } ··· 112 112 size_t copy_from_iter(void *addr, size_t bytes, struct iov_iter *i) 113 113 { 114 114 if (unlikely(!check_copy_size(addr, bytes, false))) 115 - return bytes; 115 + return 0; 116 116 else 117 117 return _copy_from_iter(addr, bytes, i); 118 118 } ··· 130 130 size_t copy_from_iter_nocache(void *addr, size_t bytes, struct iov_iter *i) 131 131 { 132 132 if (unlikely(!check_copy_size(addr, bytes, false))) 133 - return bytes; 133 + return 0; 134 134 else 135 135 return _copy_from_iter_nocache(addr, bytes, i); 136 136 } ··· 160 160 size_t copy_from_iter_flushcache(void *addr, size_t bytes, struct iov_iter *i) 161 161 { 162 162 if (unlikely(!check_copy_size(addr, bytes, false))) 163 - return bytes; 163 + return 0; 164 164 else 165 165 return _copy_from_iter_flushcache(addr, bytes, i); 166 166 }