Re: [PATCH 1/2] fscrypto: don't use on-stack buffer for filename encryption

2016-11-15 Thread Theodore Ts'o
On Thu, Nov 03, 2016 at 03:03:01PM -0700, Eric Biggers wrote: > With the new (in 4.9) option to use a virtually-mapped stack > (CONFIG_VMAP_STACK), stack buffers cannot be used as input/output for > the scatterlist crypto API because they may not be directly mappable to > struct page. For short

Re: [PATCH 1/2] fscrypto: don't use on-stack buffer for filename encryption

2016-11-07 Thread Christoph Hellwig
On Sat, Nov 05, 2016 at 07:13:49AM -0800, Kent Overstreet wrote: > Vmalloc memory does have struct pages - you just need to use vmalloc_to_page() > instead of virt_to_page. Look at drivers/md/bcache/util.c bch_bio_map() if you > want an example. That example seems to be clearly broken on

Re: [PATCH 1/2] fscrypto: don't use on-stack buffer for filename encryption

2016-11-07 Thread Richard Weinberger
On 03.11.2016 23:03, Eric Biggers wrote: > With the new (in 4.9) option to use a virtually-mapped stack > (CONFIG_VMAP_STACK), stack buffers cannot be used as input/output for > the scatterlist crypto API because they may not be directly mappable to > struct page. For short filenames,

Re: [PATCH 1/2] fscrypto: don't use on-stack buffer for filename encryption

2016-11-06 Thread Andy Lutomirski
On Nov 5, 2016 8:13 AM, "Kent Overstreet" wrote: > > On Thu, Nov 03, 2016 at 03:03:01PM -0700, Eric Biggers wrote: > > With the new (in 4.9) option to use a virtually-mapped stack > > (CONFIG_VMAP_STACK), stack buffers cannot be used as input/output for > > the

Re: [PATCH 1/2] fscrypto: don't use on-stack buffer for filename encryption

2016-11-05 Thread Kent Overstreet
On Thu, Nov 03, 2016 at 03:03:01PM -0700, Eric Biggers wrote: > With the new (in 4.9) option to use a virtually-mapped stack > (CONFIG_VMAP_STACK), stack buffers cannot be used as input/output for > the scatterlist crypto API because they may not be directly mappable to > struct page. For short

[PATCH 1/2] fscrypto: don't use on-stack buffer for filename encryption

2016-11-03 Thread Eric Biggers
With the new (in 4.9) option to use a virtually-mapped stack (CONFIG_VMAP_STACK), stack buffers cannot be used as input/output for the scatterlist crypto API because they may not be directly mappable to struct page. For short filenames, fname_encrypt() was encrypting a stack buffer holding the