All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers3@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: kernel-hardening@lists.openwall.com, luto@amacapital.net,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, luto@kernel.org, smueller@chronox.de
Subject: [kernel-hardening] Re: Remaining crypto API regressions with CONFIG_VMAP_STACK
Date: Sat, 10 Dec 2016 00:39:23 -0800	[thread overview]
Message-ID: <20161210083923.GB8630@zzz> (raw)
In-Reply-To: <20161210081643.GA384@gondor.apana.org.au>

On Sat, Dec 10, 2016 at 04:16:43PM +0800, Herbert Xu wrote:
> Why did you drop me from the CC list when you were replying to
> my email?
> 

Sorry --- this thread is Cc'ed to the kernel-hardening mailing list (which was
somewhat recently revived), and I replied to the email that reached me from
there.  It looks like it currently behaves a little differently from the vger
mailing lists, in that it replaces "Reply-To" with the address of the mailing
list itself rather than the sender.  So that's how you got dropped.  It also
seems to add a prefix to the subject...

I
> >> Are you sure? Any instance of *_ON_STACK must only be used with
> >> sync algorithms and most drivers under drivers/crypto declare
> >> themselves as async.
> > 
> > Why exactly is that?  Obviously, it wouldn't work if you returned from the stack
> > frame before the request completed, but does anything stop someone from using an
> > *_ON_STACK() request and then waiting for the request to complete before
> > returning from the stack frame?
> 
> The *_ON_STACK variants (except SHASH of course) were simply hacks
> to help legacy crypto API users to cope with the new async interface.
> In general we should avoid using the sync interface when possible.
> 
> It's a bad idea for the obvious reason that most of our async
> algorithms want to DMA and that doesn't work very well when you're
> using memory from the stack.

Sure, I just feel that the idea of "is this algorithm asynchronous?" is being
conflated with the idea of "does this algorithm operate on physical memory?".
Also, if *_ON_STACK are really not allowed with asynchronous algorithms can
there at least be a comment or a WARN_ON() to express this?

Thanks,

Eric

WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers3@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: kernel-hardening@lists.openwall.com, luto@amacapital.net,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, luto@kernel.org, smueller@chronox.de
Subject: Re: Remaining crypto API regressions with CONFIG_VMAP_STACK
Date: Sat, 10 Dec 2016 00:39:23 -0800	[thread overview]
Message-ID: <20161210083923.GB8630@zzz> (raw)
In-Reply-To: <20161210081643.GA384@gondor.apana.org.au>

On Sat, Dec 10, 2016 at 04:16:43PM +0800, Herbert Xu wrote:
> Why did you drop me from the CC list when you were replying to
> my email?
> 

Sorry --- this thread is Cc'ed to the kernel-hardening mailing list (which was
somewhat recently revived), and I replied to the email that reached me from
there.  It looks like it currently behaves a little differently from the vger
mailing lists, in that it replaces "Reply-To" with the address of the mailing
list itself rather than the sender.  So that's how you got dropped.  It also
seems to add a prefix to the subject...

I
> >> Are you sure? Any instance of *_ON_STACK must only be used with
> >> sync algorithms and most drivers under drivers/crypto declare
> >> themselves as async.
> > 
> > Why exactly is that?  Obviously, it wouldn't work if you returned from the stack
> > frame before the request completed, but does anything stop someone from using an
> > *_ON_STACK() request and then waiting for the request to complete before
> > returning from the stack frame?
> 
> The *_ON_STACK variants (except SHASH of course) were simply hacks
> to help legacy crypto API users to cope with the new async interface.
> In general we should avoid using the sync interface when possible.
> 
> It's a bad idea for the obvious reason that most of our async
> algorithms want to DMA and that doesn't work very well when you're
> using memory from the stack.

Sure, I just feel that the idea of "is this algorithm asynchronous?" is being
conflated with the idea of "does this algorithm operate on physical memory?".
Also, if *_ON_STACK are really not allowed with asynchronous algorithms can
there at least be a comment or a WARN_ON() to express this?

Thanks,

Eric

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers3@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: kernel-hardening@lists.openwall.com, luto@amacapital.net,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, luto@kernel.org, smueller@chronox.de
Subject: Re: Remaining crypto API regressions with CONFIG_VMAP_STACK
Date: Sat, 10 Dec 2016 00:39:23 -0800	[thread overview]
Message-ID: <20161210083923.GB8630@zzz> (raw)
In-Reply-To: <20161210081643.GA384@gondor.apana.org.au>

On Sat, Dec 10, 2016 at 04:16:43PM +0800, Herbert Xu wrote:
> Why did you drop me from the CC list when you were replying to
> my email?
> 

Sorry --- this thread is Cc'ed to the kernel-hardening mailing list (which was
somewhat recently revived), and I replied to the email that reached me from
there.  It looks like it currently behaves a little differently from the vger
mailing lists, in that it replaces "Reply-To" with the address of the mailing
list itself rather than the sender.  So that's how you got dropped.  It also
seems to add a prefix to the subject...

I
> >> Are you sure? Any instance of *_ON_STACK must only be used with
> >> sync algorithms and most drivers under drivers/crypto declare
> >> themselves as async.
> > 
> > Why exactly is that?  Obviously, it wouldn't work if you returned from the stack
> > frame before the request completed, but does anything stop someone from using an
> > *_ON_STACK() request and then waiting for the request to complete before
> > returning from the stack frame?
> 
> The *_ON_STACK variants (except SHASH of course) were simply hacks
> to help legacy crypto API users to cope with the new async interface.
> In general we should avoid using the sync interface when possible.
> 
> It's a bad idea for the obvious reason that most of our async
> algorithms want to DMA and that doesn't work very well when you're
> using memory from the stack.

Sure, I just feel that the idea of "is this algorithm asynchronous?" is being
conflated with the idea of "does this algorithm operate on physical memory?".
Also, if *_ON_STACK are really not allowed with asynchronous algorithms can
there at least be a comment or a WARN_ON() to express this?

Thanks,

Eric

  reply	other threads:[~2016-12-10  8:39 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-09 23:08 [kernel-hardening] Remaining crypto API regressions with CONFIG_VMAP_STACK Eric Biggers
2016-12-09 23:08 ` Eric Biggers
2016-12-09 23:08 ` Eric Biggers
2016-12-10  5:25 ` [kernel-hardening] " Andy Lutomirski
2016-12-10  5:25   ` Andy Lutomirski
2016-12-10  5:25   ` Andy Lutomirski
2016-12-10  5:32   ` [kernel-hardening] " Herbert Xu
2016-12-10  5:32     ` Herbert Xu
2016-12-10  5:32     ` Herbert Xu
2016-12-10  6:03     ` [kernel-hardening] " Eric Biggers
2016-12-10  6:03       ` Eric Biggers
2016-12-10  8:16       ` Herbert Xu
2016-12-10  8:16         ` Herbert Xu
2016-12-10  8:39         ` Eric Biggers [this message]
2016-12-10  8:39           ` Eric Biggers
2016-12-10  8:39           ` Eric Biggers
2016-12-10  5:37   ` [kernel-hardening] " Herbert Xu
2016-12-10  5:37     ` Herbert Xu
2016-12-10  5:37     ` Herbert Xu
2016-12-10  6:30     ` [kernel-hardening] " Eric Biggers
2016-12-10  6:30       ` Eric Biggers
2016-12-10 14:45     ` Jason A. Donenfeld
2016-12-10 14:45       ` Jason A. Donenfeld
2016-12-10 17:48       ` Andy Lutomirski
2016-12-10 17:48         ` Andy Lutomirski
2016-12-10  5:55   ` Eric Biggers
2016-12-10  5:55     ` Eric Biggers
2016-12-10  5:55     ` Eric Biggers
2016-12-11 19:13 ` [kernel-hardening] " Andy Lutomirski
2016-12-11 19:13   ` Andy Lutomirski
2016-12-11 19:13   ` Andy Lutomirski
2016-12-11 23:31   ` [kernel-hardening] " Eric Biggers
2016-12-11 23:31     ` Eric Biggers
2016-12-11 23:31     ` Eric Biggers
2016-12-12 18:34 ` [kernel-hardening] " Andy Lutomirski
2016-12-12 18:34   ` Andy Lutomirski
2016-12-12 18:34   ` Andy Lutomirski
2016-12-12 18:45   ` [kernel-hardening] " Gary R Hook
2016-12-12 18:45     ` Gary R Hook
2016-12-12 18:45     ` Gary R Hook
2016-12-12 18:45     ` Gary R Hook
2016-12-13  3:39     ` [kernel-hardening] " Herbert Xu
2016-12-13  3:39       ` Herbert Xu
2016-12-13  3:39       ` Herbert Xu
2016-12-13  3:39   ` [kernel-hardening] " Herbert Xu
2016-12-13  3:39     ` Herbert Xu
2016-12-13  3:39     ` Herbert Xu
2016-12-13 17:06     ` [kernel-hardening] " Andy Lutomirski
2016-12-13 17:06       ` Andy Lutomirski
2016-12-13 17:06       ` Andy Lutomirski
2016-12-14  4:56       ` [kernel-hardening] " Herbert Xu
2016-12-14  4:56         ` Herbert Xu
2016-12-14  4:56         ` Herbert Xu

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=20161210083923.GB8630@zzz \
    --to=ebiggers3@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@amacapital.net \
    --cc=luto@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.