Re: [PATCH v3 12/18] crypto: switch af_alg_make_sg() to iov_iter

From
Al Viro <viro@ZenIV.linux.org.uk>
Date
2015-02-09 17:28:11
Also in
linux-crypto
Reply to
Stephan Mueller, 2015-02-09
On Mon, Feb 09, 2015 at 02:33:48PM +0100, Stephan Mueller wrote:
quoted

-int af_alg_make_sg(struct af_alg_sgl *sgl, void __user *addr, int len,
-		   int write)
+int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len)
Shouldn't len be size_t? iov_iter_get_pages wants a size_t. Also, the 
invocation of af_alg_make_sg uses an unsigned variable that is provided by 
userspace.
Keepo in mind that rw_copy_check_uvector() does, among other things,
verify that total length is less than 2^31.  So this code doesn't
suffer from wraparounds; it might make sense to switch to size_t here,
but that's a separate patch, IMO.  For this conversion I just kept
the type that used to be there.
Thread (80 messages) 80 messages, 6 authors, last reply 2015-02-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help