Re: [PATCH v2 0/8] ensure bios aren't split in middle of crypto data unit

2021-03-26 Thread Satya Tangirala
On Thu, Mar 25, 2021 at 08:46:20PM -0700, Bart Van Assche wrote: > On 3/25/21 6:39 PM, Satya Tangirala wrote: > > On Thu, Mar 25, 2021 at 02:51:31PM -0700, Bart Van Assche wrote: > >> Are you sure that the block layer core splits bios at logical block > >> boundaries?

Re: [PATCH v2 0/8] ensure bios aren't split in middle of crypto data unit

2021-03-25 Thread Satya Tangirala
On Thu, Mar 25, 2021 at 02:51:31PM -0700, Bart Van Assche wrote: > On 3/25/21 2:26 PM, Satya Tangirala wrote: > > When a bio has an encryption context, its size must be aligned to its > > crypto data unit size. A bio must not be split in the middle of a data > > unit. Current

Re: [PATCH 0/7] ensure bios aren't split in middle of crypto data unit

2021-03-25 Thread Satya Tangirala
On Thu, Jan 21, 2021 at 05:11:29PM +, Christoph Hellwig wrote: > On Thu, Jan 14, 2021 at 03:47:16PM +0000, Satya Tangirala wrote: > > When a bio has an encryption context, its size must be aligned to its > > crypto data unit size. A bio must not be split in the middle of

[PATCH v2 7/8] blk-merge: Ensure bios aren't split in middle of a crypto data unit

2021-03-25 Thread Satya Tangirala
it anymore Signed-off-by: Satya Tangirala --- block/blk-merge.c | 49 ++- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index ffb4aa0ea68b..2903de62aaca 100644 --- a/block/blk-merge.c +++ b/block/b

[PATCH v2 8/8] block: add WARN() in bio_split() for sector alignment

2021-03-25 Thread Satya Tangirala
eract with inline encryption). Signed-off-by: Satya Tangirala --- block/bio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/bio.c b/block/bio.c index 26b7f721cda8..cb348f134a15 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1458,6 +1458,7 @@ struct bio *bio_split(struct bio *bio, i

[PATCH v2 6/8] block: keyslot-manager: introduce blk_ksm_restrict_dus_to_queue_limits()

2021-03-25 Thread Satya Tangirala
function before actually registering the ksm with a queue. Signed-off-by: Satya Tangirala --- block/keyslot-manager.c | 59 + 1 file changed, 59 insertions(+) diff --git a/block/keyslot-manager.c b/block/keyslot-manager.c index 2a2b1a9785d2..fad6d9c4b649 100644

[PATCH v2 3/8] block: blk-crypto: introduce blk_crypto_bio_sectors_alignment()

2021-03-25 Thread Satya Tangirala
bio_split() should be aligned to blk_crypto_bio_sectors_alignment(). Signed-off-by: Satya Tangirala --- block/blk-crypto-internal.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/block/blk-crypto-internal.h b/block/blk-crypto-internal.h index 0d36aae538d7..304e90ed99f5

[PATCH v2 2/8] dm,mmc,ufshcd: handle error from blk_ksm_register()

2021-03-25 Thread Satya Tangirala
ndle the return value appropriately. Signed-off-by: Satya Tangirala --- drivers/md/dm-table.c| 3 ++- drivers/mmc/core/crypto.c| 6 -- drivers/scsi/ufs/ufshcd-crypto.c | 6 -- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm-table.c

[PATCH v2 4/8] block: introduce bio_required_sector_alignment()

2021-03-25 Thread Satya Tangirala
This function returns the required alignment for the number of sectors in a bio. In particular, the number of sectors passed to bio_split() must be aligned to this value. Signed-off-by: Satya Tangirala --- block/blk.h | 12 1 file changed, 12 insertions(+) diff --git a/block/blk.h

[PATCH v2 5/8] block: respect bio_required_sector_alignment() in blk-crypto-fallback

2021-03-25 Thread Satya Tangirala
Make blk_crypto_split_bio_if_needed() respect bio_required_sector_alignment() when calling bio_split(). Signed-off-by: Satya Tangirala --- block/blk-crypto-fallback.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c index

[PATCH v2 1/8] block: introduce blk_ksm_is_empty()

2021-03-25 Thread Satya Tangirala
This function checks if a given keyslot manager supports any encryption mode/data unit size combination (and returns true if there is no such supported combination). Helps clean up code a little. Signed-off-by: Satya Tangirala --- block/keyslot-manager.c | 13 + drivers/md

[PATCH v2 0/8] ensure bios aren't split in middle of crypto data unit

2021-03-25 Thread Satya Tangirala
est_dummy_encryption with and without the 'inlinecrypt' mount option. Satya Tangirala (8): block: introduce blk_ksm_is_empty() dm,mmc,ufshcd: handle error from blk_ksm_register() block: blk-crypto: introduce blk_crypto_bio_sectors_alignment() block: introduce bio_required_

Re: [PATCH] block: keyslot-manager: fix error return code of blk_ksm_evict_key()

2021-03-09 Thread Satya Tangirala
On Tue, Mar 09, 2021 at 01:18:12AM -0800, Jia-Ju Bai wrote: > When blk_ksm_find_keyslot() returns NULL to slot, no error return code > of blk_ksm_evict_key() is assigned. > To fix this bug, err is assigned with -ENOENT in this case. > > Fixes: 1b2628397058 ("block: Keyslot Manager for Inline Encry

Re: [PATCH v4 0/5] add support for inline encryption to device mapper

2021-02-11 Thread Satya Tangirala
On Thu, Feb 11, 2021 at 06:04:59PM -0500, Mike Snitzer wrote: > On Thu, Feb 11 2021 at 6:01pm -0500, > Satya Tangirala wrote: > > > On Wed, Feb 10, 2021 at 12:59:59PM -0700, Jens Axboe wrote: > > > On 2/10/21 12:33 PM, Mike Snitzer wrote: > > > >

Re: [PATCH v4 0/5] add support for inline encryption to device mapper

2021-02-11 Thread Satya Tangirala
On Wed, Feb 10, 2021 at 12:59:59PM -0700, Jens Axboe wrote: > On 2/10/21 12:33 PM, Mike Snitzer wrote: > > On Mon, Feb 01 2021 at 12:10am -0500, > > Satya Tangirala wrote: > > > >> This patch series adds support for inline encryption to the device mapper. &g

Re: [PATCH v4 3/5] dm: add support for passing through inline crypto support

2021-02-11 Thread Satya Tangirala
On Wed, Feb 10, 2021 at 12:17:30PM -0800, Eric Biggers wrote: > On Mon, Feb 01, 2021 at 05:10:17AM +0000, Satya Tangirala wrote: > > Update the device-mapper core to support exposing the inline crypto > > support of the underlying device(s) through the device-mapper device. > &g

[PATCH v5 4/5] dm: support key eviction from keyslot managers of underlying devices

2021-02-11 Thread Satya Tangirala
Biggers Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers --- block/blk-crypto.c| 1 + drivers/md/dm-table.c | 53 +++ 2 files changed, 54 insertions(+) diff --git a/block/blk-crypto.c b/block/blk-crypto.c index 5da43f0973b4..c2be8f15006c 100644

[PATCH v5 5/5] dm: set DM_TARGET_PASSES_CRYPTO feature for some targets

2021-02-11 Thread Satya Tangirala
dm-linear and dm-flakey obviously can pass through inline crypto support. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers --- drivers/md/dm-flakey.c | 4 +++- drivers/md/dm-linear.c | 5 +++-- 2 files changed, 6 insertions

[PATCH v5 3/5] dm: add support for passing through inline crypto support

2021-02-11 Thread Satya Tangirala
me inline encryption capability becoming no longer supported will be rejected. For the sake of clarity, key eviction from underlying devices will be handled in a future patch. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers

[PATCH v5 2/5] block: keyslot-manager: Introduce functions for device mapper support

2021-02-11 Thread Satya Tangirala
" (since there's no synchronization between bio creation and when a device may want to change its advertised capabilities) - so a previously advertised crypto capability must always continue to be supported. This function can be used to check that a new ksm is a valid replacement for an old k

[PATCH v5 1/5] block: keyslot-manager: Introduce passthrough keyslot manager

2021-02-11 Thread Satya Tangirala
ys into any keyslots in the passthrough keyslot manager. Instead, if/when the bio is resubmitted to the underlying device, blk-crypto will try to program the key into the underlying device's keyslot manager. Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers Ack

[PATCH v5 0/5] add support for inline encryption to device mapper

2021-02-11 Thread Satya Tangirala
only when at least one crypto capability is supported (since a NULL value for q->ksm represents "no crypto support" anyway). - Remove the struct blk_keyslot_manager field from struct mapped_device. This patch now relies on just directly setting up the keyslot manager in

Re: [PATCH v3 3/6] dm: add support for passing through inline crypto support

2021-01-31 Thread Satya Tangirala
On Thu, Jan 14, 2021 at 01:00:49PM -0500, Mike Snitzer wrote: > On Tue, Dec 29 2020 at 3:55am -0500, > Satya Tangirala wrote: > > > Update the device-mapper core to support exposing the inline crypto > > support of the underlying device(s) through the device-mapper device

[PATCH v4 4/5] dm: support key eviction from keyslot managers of underlying devices

2021-01-31 Thread Satya Tangirala
Biggers Signed-off-by: Satya Tangirala --- block/blk-crypto.c| 1 + drivers/md/dm-table.c | 53 +++ 2 files changed, 54 insertions(+) diff --git a/block/blk-crypto.c b/block/blk-crypto.c index 5da43f0973b4..c2be8f15006c 100644 --- a/block/blk-crypto.c

[PATCH v4 5/5] dm: set DM_TARGET_PASSES_CRYPTO feature for some targets

2021-01-31 Thread Satya Tangirala
dm-linear and dm-flakey obviously can pass through inline crypto support. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Satya Tangirala --- drivers/md/dm-flakey.c | 4 +++- drivers/md/dm-linear.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff

[PATCH v4 3/5] dm: add support for passing through inline crypto support

2021-01-31 Thread Satya Tangirala
me inline encryption capability becoming no longer supported will be rejected. For the sake of clarity, key eviction from underlying devices will be handled in a future patch. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Satya Tangirala --- drivers/md/dm-core.h

[PATCH v4 2/5] block: keyslot-manager: Introduce functions for device mapper support

2021-01-31 Thread Satya Tangirala
" (since there's no synchronization between bio creation and when a device may want to change its advertised capabilities) - so a previously advertised crypto capability must always continue to be supported. This function can be used to check that a new ksm is a valid replacement fo

[PATCH v4 1/5] block: keyslot-manager: Introduce passthrough keyslot manager

2021-01-31 Thread Satya Tangirala
ys into any keyslots in the passthrough keyslot manager. Instead, if/when the bio is resubmitted to the underlying device, blk-crypto will try to program the key into the underlying device's keyslot manager. Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers --- block/keyslot-manag

[PATCH v4 0/5] add support for inline encryption to device mapper

2021-01-31 Thread Satya Tangirala
quot;no crypto support" anyway). - Remove the struct blk_keyslot_manager field from struct mapped_device. This patch now relies on just directly setting up the keyslot manager in the request queue, since each DM device is tied to only 1 queue. Satya Tangirala (5): block: keys

[PATCH v8 3/8] fscrypt: add functions for direct I/O support

2021-01-21 Thread Satya Tangirala
ce to call fscrypt_mergeable_bio() on every block added to a bio. So we need this function which limits a logical range in one go. Signed-off-by: Eric Biggers Co-developed-by: Satya Tangirala Signed-off-by: Satya Tangirala --- fs/crypto/crypto.c | 8 + fs/crypto/inline_crypt.c

[PATCH v8 1/8] block: blk-crypto-fallback: handle data unit split across multiple bvecs

2021-01-21 Thread Satya Tangirala
similar to those for direct I/O on unencrypted files. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Satya Tangirala --- block/blk-crypto-fallback.c | 203 +++- 1 file changed, 156 insertions(+), 47 deletions(-) diff --git a/block/blk

[PATCH v8 2/8] block: blk-crypto: relax alignment requirements for bvecs in bios

2021-01-21 Thread Satya Tangirala
rypto now only needs the total size of the bio to be aligned to the crypto data unit size. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Satya Tangirala --- block/blk-crypto.c | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/bloc

[PATCH v8 4/8] direct-io: add support for fscrypt using blk-crypto

2021-01-21 Thread Satya Tangirala
methods like IV_INO_LBLK_32). Signed-off-by: Eric Biggers Co-developed-by: Satya Tangirala Signed-off-by: Satya Tangirala Reviewed-by: Jaegeuk Kim --- fs/direct-io.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/fs/direct-io.c b/fs/direct-io.c index

[PATCH v8 5/8] iomap: support direct I/O with fscrypt using blk-crypto

2021-01-21 Thread Satya Tangirala
fscrypt_limit_io_blocks() appropriately. Signed-off-by: Eric Biggers Co-developed-by: Satya Tangirala Signed-off-by: Satya Tangirala --- fs/iomap/direct-io.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index 933f234d5bec..b4240cc3c9f9 100644 --- a/fs/iomap

[PATCH v8 6/8] ext4: support direct I/O with fscrypt using blk-crypto

2021-01-21 Thread Satya Tangirala
edge case in one of the fscrypt IV generation methods. Signed-off-by: Eric Biggers Co-developed-by: Satya Tangirala Signed-off-by: Satya Tangirala Reviewed-by: Jaegeuk Kim Acked-by: Theodore Ts'o --- fs/ext4/file.c | 10 ++ fs/ext4/inode.c | 7 +++ 2 files changed, 13 i

[PATCH v8 8/8] fscrypt: update documentation for direct I/O support

2021-01-21 Thread Satya Tangirala
Update fscrypt documentation to reflect the addition of direct I/O support and document the necessary conditions for direct I/O on encrypted files. Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers Reviewed-by: Jaegeuk Kim --- Documentation/filesystems/fscrypt.rst | 21

[PATCH v8 7/8] f2fs: support direct I/O with fscrypt using blk-crypto

2021-01-21 Thread Satya Tangirala
y: Eric Biggers Co-developed-by: Satya Tangirala Signed-off-by: Satya Tangirala Acked-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index bb11759191dc..5130423a13e7 100644 --- a/fs/f2fs/f2fs.h +++ b

[PATCH v8 0/8] add support for direct I/O with fscrypt using blk-crypto

2021-01-21 Thread Satya Tangirala
for direct I/O support direct-io: add support for fscrypt using blk-crypto iomap: support direct I/O with fscrypt using blk-crypto ext4: support direct I/O with fscrypt using blk-crypto f2fs: support direct I/O with fscrypt using blk-crypto Satya Tangirala (3): block: blk-crypto-fallback:

[PATCH 4/7] block: respect blk_crypto_bio_sectors_alignment() in blk-crypto-fallback

2021-01-14 Thread Satya Tangirala
Make blk_crypto_split_bio_if_needed() respect blk_crypto_bio_sectors_alignment() when calling bio_split(). Signed-off-by: Satya Tangirala --- block/blk-crypto-fallback.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c index

[PATCH 7/7] block: compute nsegs more accurately in blk_bio_segment_split()

2021-01-14 Thread Satya Tangirala
smallest number of segments required for the aligned number of sectors in the split bio). Signed-off-by: Satya Tangirala --- block/blk-merge.c | 97 ++- 1 file changed, 80 insertions(+), 17 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c

[PATCH 6/7] block: add WARN() in bio_split() for sector alignment

2021-01-14 Thread Satya Tangirala
The number of sectors passed to bio_split() should be aligned to blk_crypto_bio_sectors_alignment(). All callers have been updated to ensure this, so add a WARN() if the number of sectors is not aligned. Signed-off-by: Satya Tangirala --- block/bio.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH 5/7] block: respect blk_crypto_bio_sectors_alignment() in blk-merge

2021-01-14 Thread Satya Tangirala
trying to calculate the exact number of nsegs required for the aligned number of sectors. A future patch will attempt to calculate nsegs more accurately. Signed-off-by: Satya Tangirala --- block/blk-merge.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block/blk-merge.c b/block/blk-merge.c

[PATCH 3/7] block: respect blk_crypto_bio_sectors_alignment() in bounce.c

2021-01-14 Thread Satya Tangirala
Make __blk_queue_bounce respect blk_crypto_bio_sectors_alignment() when calling bio_split(). Signed-off-by: Satya Tangirala --- block/bounce.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/bounce.c b/block/bounce.c index d3f51acd6e3b..7800e2a5a0f8 100644 --- a/block/bounce.c

[PATCH 2/7] block: blk-crypto: Introduce blk_crypto_bio_sectors_alignment()

2021-01-14 Thread Satya Tangirala
bio_split() should be aligned to blk_crypto_bio_sectors_alignment(). Signed-off-by: Satya Tangirala --- block/blk-crypto-internal.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/block/blk-crypto-internal.h b/block/blk-crypto-internal.h index 0d36aae538d7..304e90ed99f5

[PATCH 1/7] block: make blk_bio_segment_split() able to fail and return error

2021-01-14 Thread Satya Tangirala
bio is aligned to the data unit size of the bio crypt context of the bio (if it exists). It's possible that the largest aligned size that satisfies all the requirements of blk_bio_segment_split() is 0, at which point we need error out. Signed-off-by: Satya Tangirala --- block/blk-me

[PATCH 0/7] ensure bios aren't split in middle of crypto data unit

2021-01-14 Thread Satya Tangirala
s on the SDM630 chipset (which has eMMC inline encryption hardware with logical block size 512 bytes) with test_dummy_encryption with and without the 'inlinecrypt' mount option. Satya Tangirala (7): block: make blk_bio_segment_split() able to fail and return error blo

Re: [PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2021-01-07 Thread Satya Tangirala
ible to emergency_thaw_bdev() in fs/buffer.c) In my version of the patch, I set bdev->bd_fsfreeze_sb to NULL only *after* we check that the call to thaw_super() succeeded to avoid this. > if (sb->s_op->thaw_super) > error = sb->s_op->thaw_super(sb); >

[PATCH v3 0/6] add support for inline encryption to device mapper

2020-12-29 Thread Satya Tangirala
st one crypto capability is supported (since a NULL value for q->ksm represents "no crypto support" anyway). - Remove the struct blk_keyslot_manager field from struct mapped_device. This patch now relies on just directly setting up the keyslot manager in the request

[PATCH v3 6/6] dm: set DM_TARGET_PASSES_CRYPTO feature for some targets

2020-12-29 Thread Satya Tangirala
dm-linear and dm-flakey obviously can pass through inline crypto support. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Satya Tangirala --- drivers/md/dm-flakey.c | 4 +++- drivers/md/dm-linear.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff

[PATCH v3 5/6] dm: Verify inline encryption capabilities of new table when it is loaded

2020-12-29 Thread Satya Tangirala
since the capabilities of underlying child devices can expand during the time between the table load and table swap (which in turn can cause the capabilities of this parent device to expand as well). Signed-off-by: Satya Tangirala --- drivers/md/dm-ioctl.c | 8 drivers/md/dm.c

[PATCH v3 3/6] dm: add support for passing through inline crypto support

2020-12-29 Thread Satya Tangirala
me inline encryption capability becoming no longer supported will be rejected. For the sake of clarity, key eviction from underlying devices will be handled in a future patch. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Satya Tangirala --

[PATCH v3 1/6] block: keyslot-manager: Introduce passthrough keyslot manager

2020-12-29 Thread Satya Tangirala
ys into any keyslots in the passthrough keyslot manager. Instead, if/when the bio is resubmitted to the underlying device, blk-crypto will try to program the key into the underlying device's keyslot manager. Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers --- block/keyslot-manag

[PATCH v3 4/6] dm: Support key eviction from keyslot managers of underlying devices

2020-12-29 Thread Satya Tangirala
Biggers Signed-off-by: Satya Tangirala --- block/blk-crypto.c | 1 + drivers/md/dm.c| 53 ++ 2 files changed, 54 insertions(+) diff --git a/block/blk-crypto.c b/block/blk-crypto.c index 5da43f0973b4..c2be8f15006c 100644 --- a/block/blk-crypto.c +++ b

[PATCH v3 2/6] block: keyslot-manager: Introduce functions for device mapper support

2020-12-29 Thread Satya Tangirala
new ksm is a valid replacement for an old ksm. Signed-off-by: Satya Tangirala --- block/keyslot-manager.c | 91 + include/linux/keyslot-manager.h | 9 2 files changed, 100 insertions(+) diff --git a/block/keyslot-manager.c b/block/keyslot-manager.c index

Re: [PATCH v2 2/3] fscrypt: Add metadata encryption support

2020-12-24 Thread Satya Tangirala
I realized I didn't update fscrypt_mergeable_bio() to take metadata encryption into account, so bios will be more fragmented than required. I'll fix it in v3.

Re: [PATCH 0/3] add support for metadata encryption to F2FS

2020-12-24 Thread Satya Tangirala
On Tue, Dec 22, 2020 at 07:47:45PM +0800, Chao Yu wrote: > On 2020/12/18 19:53, Satya Tangirala wrote: > > On Fri, Dec 18, 2020 at 05:02:23PM +0800, Chao Yu wrote: > > > But, what's the plan about supporting software encryption for metadata? > > > Current >

[PATCH] fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb

2020-12-23 Thread Satya Tangirala
oo subtle/easily overlooked in future). This fixes the currently panicking xfstests generic/085. Fixes: 040f04bd2e82 ("fs: simplify freeze_bdev/thaw_bdev") Signed-off-by: Satya Tangirala --- fs/block_dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/block_dev.c b/fs/block_dev.

Re: [PATCH 0/3] add support for metadata encryption to F2FS

2020-12-18 Thread Satya Tangirala
On Fri, Dec 18, 2020 at 05:02:23PM +0800, Chao Yu wrote: > On 2020/12/17 23:44, Satya Tangirala wrote: > > On Sat, Oct 10, 2020 at 05:53:06PM +0800, Chao Yu wrote: > > > Why not using nid as DUN, then GC could migrate encrypted node block > > > directly via > >

Re: [f2fs-dev] [PATCH v3 2/3] f2fs-tools:sload.f2fs compression support

2020-12-18 Thread Satya Tangirala
On Tue, Dec 08, 2020 at 04:15:54PM +0800, Robin Hsu wrote: > From: Robin Hsu > > Add F2FS compression support for sload > * Support file extension filter, either default-accept or default-deny > policy > * Support choice of compression algorithm, LZO (version 2) or LZ4 > (default) > * Support

Re: [PATCH v2 0/3] add support for metadata encryption to F2FS

2020-12-17 Thread Satya Tangirala
On Thu, Dec 17, 2020 at 06:34:27PM -0500, Theodore Y. Ts'o wrote: > On Thu, Dec 17, 2020 at 08:51:14PM +0000, Satya Tangirala wrote: > > On Thu, Dec 17, 2020 at 01:08:49PM -0500, Theodore Y. Ts'o wrote: > > > On Thu, Dec 17, 2020 at 03:04:32PM +, Satya Tangira

Re: [PATCH v2 0/3] add support for metadata encryption to F2FS

2020-12-17 Thread Satya Tangirala
On Thu, Dec 17, 2020 at 01:08:49PM -0500, Theodore Y. Ts'o wrote: > On Thu, Dec 17, 2020 at 03:04:32PM +0000, Satya Tangirala wrote: > > This patch series adds support for metadata encryption to F2FS using > > blk-crypto. > > Is there a companion patch series needed so

Re: [PATCH 0/3] add support for metadata encryption to F2FS

2020-12-17 Thread Satya Tangirala
On Sat, Oct 10, 2020 at 05:53:06PM +0800, Chao Yu wrote: > On 2020/10/5 15:36, Satya Tangirala wrote: > > This patch series adds support for metadata encryption to F2FS using > > blk-crypto. > > It looks this implementation is based on hardware crypto engine, could you > p

Re: [PATCH v2 2/3] fscrypt: Add metadata encryption support

2020-12-17 Thread Satya Tangirala
I'm not yet done with the xfstests that Eric asked for - I'll send them out as soon as they're done.

Re: [PATCH v2 0/3] add support for metadata encryption to F2FS

2020-12-17 Thread Satya Tangirala
On Thu, Dec 17, 2020 at 03:04:32PM +, Satya Tangirala wrote: > Changes to the userspace > tools (that are required to test out metadata encryption with F2FS) are > also being sent out - I'll post a link as a reply to this mail once it's > out. The userspac

[PATCH v2 3/3] f2fs: Add metadata encryption support

2020-12-17 Thread Satya Tangirala
F2FS filesystem will fall back to using buffered I/O (just as attempts to do direct I/O on fscrypt encrypted files also fall back to buffered I/O). Signed-off-by: Satya Tangirala --- fs/f2fs/data.c | 17 fs/f2fs/f2fs.h | 2 ++ fs/f2fs/super.c

[PATCH v2 2/3] fscrypt: Add metadata encryption support

2020-12-17 Thread Satya Tangirala
hardware or the blk-crypto-fallback needs to be present/enabled. Signed-off-by: Satya Tangirala --- Documentation/filesystems/fscrypt.rst | 86 +++- fs/crypto/Kconfig | 12 + fs/crypto/Makefile| 1 + fs/crypto/bio.c

[PATCH v2 0/3] add support for metadata encryption to F2FS

2020-12-17 Thread Satya Tangirala
INLINE_CRYPT - fscrypt_set_bio_crypt_ctx() calls fscrypt_metadata_crypt_bio() directly, so filesystems only need to call fscrypt_set_bio_crypt_ctx() - Cleanups and updated docs Satya Tangirala (3): fscrypt, f2fs: replace fscrypt_get_devices with fscrypt_get_device fscrypt: Add metadata encryption

[PATCH v2 1/3] fscrypt, f2fs: replace fscrypt_get_devices with fscrypt_get_device

2020-12-17 Thread Satya Tangirala
cases (when they don't need the array for anything else). Signed-off-by: Satya Tangirala --- fs/crypto/inline_crypt.c | 33 ++--- fs/f2fs/super.c | 16 ++-- include/linux/fscrypt.h | 4 ++-- 3 files changed, 26 insertions(+), 27 dele

Re: [PATCH v7 0/8] add support for direct I/O with fscrypt using blk-crypto

2020-12-03 Thread Satya Tangirala
On Tue, Nov 17, 2020 at 12:15:26PM -0500, Theodore Y. Ts'o wrote: > What is the expected use case for Direct I/O using fscrypt? This > isn't a problem which is unique to fscrypt, but one of the really > unfortunate aspects of the DIO interface is the silent fallback to > buffered I/O. We've lived

Re: [PATCH v7 1/8] block: ensure bios are not split in middle of crypto data unit

2020-12-02 Thread Satya Tangirala
On Wed, Nov 25, 2020 at 02:12:35PM -0800, Eric Biggers wrote: > On Wed, Nov 18, 2020 at 12:38:15AM +0000, Satya Tangirala wrote: > > > > +/** > > > > + * update_aligned_sectors_and_segs() - Ensures that *@aligned_sectors > > > > is aligned > >

Re: [PATCH v7 1/8] block: ensure bios are not split in middle of crypto data unit

2020-11-17 Thread Satya Tangirala
On Tue, Nov 17, 2020 at 03:31:23PM -0800, Eric Biggers wrote: > On Tue, Nov 17, 2020 at 02:07:01PM +0000, Satya Tangirala wrote: > > Introduce blk_crypto_bio_sectors_alignment() that returns the required > > alignment for the number of sectors in a bio. Any bio split must ensu

[PATCH v7 1/8] block: ensure bios are not split in middle of crypto data unit

2020-11-17 Thread Satya Tangirala
blk_crypto_split_bio_if_needed() to respect blk_crypto_bio_sectors_alignment() when splitting bios. Signed-off-by: Satya Tangirala --- block/bio.c | 1 + block/blk-crypto-fallback.c | 10 ++-- block/blk-crypto-internal.h | 18 +++ block/blk-merge.c | 96

[PATCH v7 3/8] fscrypt: add functions for direct I/O support

2020-11-17 Thread Satya Tangirala
ce to call fscrypt_mergeable_bio() on every block added to a bio. So we need this function which limits a logical range in one go. Signed-off-by: Eric Biggers Co-developed-by: Satya Tangirala Signed-off-by: Satya Tangirala --- fs/crypto/crypto.c | 8 + fs/crypto/inline_crypt.c

[PATCH v7 4/8] direct-io: add support for fscrypt using blk-crypto

2020-11-17 Thread Satya Tangirala
methods like IV_INO_LBLK_32). Signed-off-by: Eric Biggers Co-developed-by: Satya Tangirala Signed-off-by: Satya Tangirala Reviewed-by: Jaegeuk Kim --- fs/direct-io.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/fs/direct-io.c b/fs/direct-io.c index

[PATCH v7 0/8] add support for direct I/O with fscrypt using blk-crypto

2020-11-17 Thread Satya Tangirala
support for fscrypt using blk-crypto iomap: support direct I/O with fscrypt using blk-crypto ext4: support direct I/O with fscrypt using blk-crypto f2fs: support direct I/O with fscrypt using blk-crypto Satya Tangirala (3): block: ensure bios are not split in middle of crypto data unit blk-cr

[PATCH v7 6/8] ext4: support direct I/O with fscrypt using blk-crypto

2020-11-17 Thread Satya Tangirala
edge case in one of the fscrypt IV generation methods. Signed-off-by: Eric Biggers Co-developed-by: Satya Tangirala Signed-off-by: Satya Tangirala Reviewed-by: Jaegeuk Kim --- fs/ext4/file.c | 10 ++ fs/ext4/inode.c | 7 +++ 2 files changed, 13 insertions(+), 4 deletions(-)

[PATCH v7 2/8] blk-crypto: don't require user buffer alignment

2020-11-17 Thread Satya Tangirala
ic Biggers Signed-off-by: Satya Tangirala --- block/blk-crypto-fallback.c | 202 +++- block/blk-crypto.c | 19 +--- 2 files changed, 157 insertions(+), 64 deletions(-) diff --git a/block/blk-crypto-fallback.c b/block/blk-crypto-fallback.c index db

[PATCH v7 8/8] fscrypt: update documentation for direct I/O support

2020-11-17 Thread Satya Tangirala
Update fscrypt documentation to reflect the addition of direct I/O support and document the necessary conditions for direct I/O on encrypted files. Signed-off-by: Satya Tangirala Reviewed-by: Eric Biggers Reviewed-by: Jaegeuk Kim --- Documentation/filesystems/fscrypt.rst | 21

[PATCH v7 5/8] iomap: support direct I/O with fscrypt using blk-crypto

2020-11-17 Thread Satya Tangirala
fscrypt_limit_io_blocks() appropriately. Signed-off-by: Eric Biggers Co-developed-by: Satya Tangirala Signed-off-by: Satya Tangirala --- fs/iomap/direct-io.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index 933f234d5bec..b4240cc3c9f9 100644 --- a/fs/iomap

[PATCH v7 7/8] f2fs: support direct I/O with fscrypt using blk-crypto

2020-11-17 Thread Satya Tangirala
y: Eric Biggers Co-developed-by: Satya Tangirala Signed-off-by: Satya Tangirala Acked-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index cb700d797296..d518e668618e 100644 --- a/fs/f2fs/f2fs.h +++ b

Re: [PATCH v2 3/4] dm: add support for passing through inline crypto support

2020-10-29 Thread Satya Tangirala
On Tue, Oct 27, 2020 at 05:17:31PM -0700, Eric Biggers wrote: > On Tue, Oct 27, 2020 at 11:58:47PM +0000, Satya Tangirala wrote: > > > > +/** > > > > + * blk_ksm_update_capabilities() - Update the restrictions of a KSM to > > > > those of > > >

Re: [PATCH v2 3/4] dm: add support for passing through inline crypto support

2020-10-27 Thread Satya Tangirala
On Tue, Oct 27, 2020 at 02:31:51PM -0700, Eric Biggers wrote: > On Thu, Oct 15, 2020 at 09:46:31PM +0000, Satya Tangirala wrote: > > Update the device-mapper core to support exposing the inline crypto > > support of the underlying device(s) through the device-mapper device. > &g

Re: [PATCH v2 1/4] block: keyslot-manager: Introduce passthrough keyslot manager

2020-10-20 Thread Satya Tangirala
On Tue, Oct 20, 2020 at 09:44:23PM -0700, Eric Biggers wrote: > On Fri, Oct 16, 2020 at 08:20:44AM +0100, Christoph Hellwig wrote: > > And this just validates my argument that calling the inline crypto work > > directly from the block layer instead of just down below in blk-mq was > > wrong. We sh

Re: [PATCH v2 2/4] block: add private field to struct keyslot_manager

2020-10-16 Thread Satya Tangirala
On Fri, Oct 16, 2020 at 08:19:41AM +0100, Christoph Hellwig wrote: > On Thu, Oct 15, 2020 at 09:46:30PM +0000, Satya Tangirala wrote: > > Add a (void *) pointer to struct keyslot_manager that the owner of the > > struct can use for any purpose it wants. > > >

Re: [PATCH 2/3] dm: add support for passing through inline crypto support

2020-10-15 Thread Satya Tangirala
On Thu, Sep 24, 2020 at 10:23:54AM -0400, Mike Snitzer wrote: > On Thu, Sep 24 2020 at 3:38am -0400, > Satya Tangirala wrote: > > > On Wed, Sep 23, 2020 at 09:21:03PM -0400, Mike Snitzer wrote: > > > On Wed, Sep 09 2020 at 7:44pm -0400, > > > Satya Tangirala

Re: [PATCH 2/3] dm: add support for passing through inline crypto support

2020-10-15 Thread Satya Tangirala
On Thu, Sep 24, 2020 at 09:40:22AM -0400, Mike Snitzer wrote: > On Thu, Sep 24 2020 at 3:48am -0400, > Satya Tangirala wrote: > > > On Wed, Sep 23, 2020 at 09:21:03PM -0400, Mike Snitzer wrote: > > > On Wed, Sep 09 2020 at 7:44pm -0400, > > > Satya Tangirala

[PATCH v2 1/4] block: keyslot-manager: Introduce passthrough keyslot manager

2020-10-15 Thread Satya Tangirala
ys into any keyslots in the passthrough keyslot manager. Instead, if/when the bio is resubmitted to the underlying device, blk-crypto will try to program the key into the underlying device's keyslot manager. Signed-off-by: Satya Tangirala --- block/keyslot-manager.c | 41 +++

[PATCH v2 0/4] add support for inline encryption to device mapper

2020-10-15 Thread Satya Tangirala
ability is supported (since a NULL value for q->ksm represents "no crypto support" anyway). - Remove the struct blk_keyslot_manager field from struct mapped_device. This patch now relies on just directly setting up the keyslot manager in the request queue, since each DM devi

[PATCH v2 3/4] dm: add support for passing through inline crypto support

2020-10-15 Thread Satya Tangirala
s. Attempts to make changes to the table that result in some inline encryption capability becoming no longer supported will be rejected. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Satya Tangirala --- block/blk-crypto.c | 1 + block/keyslot-manager.c

[PATCH v2 4/4] dm: enable may_passthrough_inline_crypto on some targets

2020-10-15 Thread Satya Tangirala
dm-linear and dm-flakey obviously can pass through inline crypto support. Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers Signed-off-by: Satya Tangirala --- drivers/md/dm-flakey.c | 1 + drivers/md/dm-linear.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/md/dm

[PATCH v2 2/4] block: add private field to struct keyslot_manager

2020-10-15 Thread Satya Tangirala
nager is embded. The primary motivation of this patch is to get around that issue. Signed-off-by: Satya Tangirala --- include/linux/keyslot-manager.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/keyslot-manager.h b/include/linux/keyslot-manager.h index 323e15dd6fa7..37f1022

Re: [PATCH 3/3] f2fs: Add metadata encryption support

2020-10-07 Thread Satya Tangirala
On Wed, Oct 07, 2020 at 02:20:52PM -0700, Eric Biggers wrote: > On Mon, Oct 05, 2020 at 07:36:06AM +0000, Satya Tangirala wrote: > > Wire up metadata encryption support with the fscrypt metadata crypt > > additions. > > > > Introduces a new mount opt

Re: [PATCH 2/3] fscrypt: Add metadata encryption support

2020-10-07 Thread Satya Tangirala
On Wed, Oct 07, 2020 at 01:52:21PM -0700, Eric Biggers wrote: > On Mon, Oct 05, 2020 at 07:36:05AM +0000, Satya Tangirala wrote: > > Introduces functions that help with metadata encryption. > > > > In particular, we introduce: > > > > fscrypt_setup_metadata_encry

Re: [PATCH 0/3] add support for metadata encryption to F2FS

2020-10-07 Thread Satya Tangirala
On Wed, Oct 07, 2020 at 02:00:40PM -0700, Eric Biggers wrote: > On Mon, Oct 05, 2020 at 07:36:03AM +0000, Satya Tangirala wrote: > > This patch series adds support for metadata encryption to F2FS using > > blk-crypto. > > This patch series needs more explanation about what

Re: [PATCH 0/3] add support for metadata encryption to F2FS

2020-10-05 Thread Satya Tangirala
On Mon, Oct 05, 2020 at 07:36:03AM +, Satya Tangirala wrote: > This patch series adds support for metadata encryption to F2FS using > blk-crypto. > > Patch 1 replaces fscrypt_get_devices (which took an array of request_queues > and filled it up) with fscrypt_get_device, which t

[PATCH 0/3] add support for metadata encryption to F2FS

2020-10-05 Thread Satya Tangirala
red to test out metadata encryption with F2FS) are also being sent out - I'll post a link as a reply to this mail once it's out. Satya Tangirala (3): fscrypt, f2fs: replace fscrypt_get_devices with fscrypt_get_device fscrypt: Add metadata encryption support f2fs: Add metadata encryptio

[PATCH 3/3] f2fs: Add metadata encryption support

2020-10-05 Thread Satya Tangirala
iles also fall back to buffered I/O). Signed-off-by: Satya Tangirala --- Documentation/filesystems/f2fs.rst | 12 ++ fs/f2fs/data.c | 24 +++ fs/f2fs/f2fs.h | 2 + fs/f2fs/super.c| 67 -- include/li

[PATCH 1/3] fscrypt, f2fs: replace fscrypt_get_devices with fscrypt_get_device

2020-10-05 Thread Satya Tangirala
cases (when they don't need the array for anything else). Signed-off-by: Satya Tangirala --- fs/crypto/inline_crypt.c | 33 ++--- fs/f2fs/super.c | 16 ++-- include/linux/fscrypt.h | 4 ++-- 3 files changed, 26 insertions(+), 27 dele

[PATCH 2/3] fscrypt: Add metadata encryption support

2020-10-05 Thread Satya Tangirala
onvenience functions that ultimately help encrypt a bio with the metadata encryption key when desired. Signed-off-by: Satya Tangirala --- fs/crypto/Kconfig | 6 + fs/crypto/Makefile | 1 + fs/crypto/fscrypt_private.h | 19 fs/crypto/inline_crypt.c| 18 ---

Re: [PATCH 2/3] dm: add support for passing through inline crypto support

2020-09-24 Thread Satya Tangirala
On Wed, Sep 23, 2020 at 09:21:03PM -0400, Mike Snitzer wrote: > On Wed, Sep 09 2020 at 7:44pm -0400, > Satya Tangirala wrote: > > > From: Eric Biggers > > > > Update the device-mapper core to support exposing the inline crypto > > support of the underlying de

  1   2   >