From: Tadeusz Struk <tadeusz.struk@intel.com>
To: Stephan Mueller <smueller@chronox.de>
Cc: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org
Subject: Re: [PATCH 2/3] crypto: algif_akcipher user space interface
Date: Wed, 22 Jul 2015 09:01:15 -0700 [thread overview]
Message-ID: <55AFBE4B.8080805@intel.com> (raw)
In-Reply-To: <1537904.OY6iC43nQX@tachyon.chronox.de>
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.
next prev parent reply other threads:[~2015-07-22 16:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 22:12 [PATCH 0/3] AF_ALG interface for akcipher Stephan Mueller
2015-07-21 22:12 ` [PATCH 1/3] crypto: af_alg - add sig gen / verify API Stephan Mueller
2015-07-21 22:13 ` [PATCH 2/3] crypto: algif_akcipher user space interface Stephan Mueller
2015-07-22 16:01 ` Tadeusz Struk [this message]
2015-07-22 18:55 ` Stephan Mueller
2015-07-22 22:04 ` Tadeusz Struk
2015-07-22 22:29 ` Stephan Mueller
2015-07-21 22:13 ` [PATCH 3/3] crypto: algif_akcipher - enable compilation Stephan Mueller
2015-07-22 1:32 ` [PATCH 0/3] AF_ALG interface for akcipher Herbert Xu
2015-07-22 4:19 ` Tadeusz Struk
2015-07-22 4:21 ` Herbert Xu
2015-07-22 11:58 ` Horia Geantă
2015-07-23 1:53 ` Herbert Xu
2015-07-23 5:14 ` Tadeusz Struk
2015-07-23 5:19 ` Herbert Xu
2015-07-23 10:16 ` Stephan Mueller
2015-07-22 7:14 ` Stephan Mueller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55AFBE4B.8080805@intel.com \
--to=tadeusz.struk@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=smueller@chronox.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.