Re: [PATCH 2/3] crypto: algif_akcipher user space interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/21/2015 03:13 PM, Stephan Mueller wrote:
> +static ssize_t akcipher_sendpage(struct socket *sock, struct page *page,
> +				 int offset, size_t size, int flags)
> +{
> +	struct sock *sk = sock->sk;
> +	struct alg_sock *ask = alg_sk(sk);
> +	struct akcipher_ctx *ctx = ask->private;
> +	int err = -EINVAL;
> +
> +	if (flags & MSG_SENDPAGE_NOTLAST)
> +		flags |= MSG_MORE;
> +
> +	lock_sock(sk);
> +
> +	/*
> +	 * We do not allow mixing of sendmsg and sendpage calls as this would
> +	 * require a hairy memory management.
> +	 *
> +	 * This check also guards against double call of sendpage.
> +	 * We require that the output buffer size must be provided with one
> +	 * sendpage request as otherwise we cannot have a linear buffer required
> +	 * by the akcipher API.
> +	 */
> +	if (ctx->req_data_ptr)
> +		goto unlock;

Shouldn't we be more flexible and copy the data if it comes in chunks here too.
The user doesn't really have control over this and it would look bad if splice
would randomly fail for a valid buffer.
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux