From: Herbert Xu <herbert@gondor.apana.org.au>
To: Crestez Dan Leonard <cdleonard@gmail.com>
Cc: eric.dumazet@gmail.com, netdev@vger.kernel.org,
linux-crypto@vger.kernel.org
Subject: Re: [RFC] tcp md5 use of alloc_percpu
Date: Fri, 24 Oct 2014 17:33:15 +0800 [thread overview]
Message-ID: <20141024093315.GA18290@gondor.apana.org.au> (raw)
In-Reply-To: <5448383A.4090908@gmail.com>
Crestez Dan Leonard <cdleonard@gmail.com> wrote:
>
>> Yep, but the sg stuff does not allow for stack variables. Because of
>> possible offloading and DMA, I dont know...
> A stack buffer is used in tcp_md5_hash_header to add a tcphdr to the
> hash. A quick grep for sg_init_one find a couple of additional instances
> of what looks like doing crypto on small stack buffers:
First of all crypto_hash_update is obsolete, don't use it in any
new code. Thanks for reminding me to get rid of existing users.
You should either use crypto_shash_update for small data, e.g., headers
or crypto_ahash_update for large data such as whole packets.
If you use shash then you may allocate your buffer on the stack. With
ahash stack memory is not allowed.
I hope this clears things up for you.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2014-10-24 9:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5447FDB2.2010906@gmail.com>
[not found] ` <1414005158.9031.22.camel@edumazet-glaptop2.roam.corp.google.com>
2014-10-22 23:05 ` [RFC] tcp md5 use of alloc_percpu Crestez Dan Leonard
2014-10-24 9:33 ` Herbert Xu [this message]
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=20141024093315.GA18290@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=cdleonard@gmail.com \
--cc=eric.dumazet@gmail.com \
--cc=linux-crypto@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox