[PATCH v12 1/4] soc: qcom: ice: make qcom_ice_program_key() take struct blk_crypto_key

2025-02-10 Thread Eric Biggers
From: Eric Biggers qcom_ice_program_key() currently accepts the key as an array of bytes, algorithm ID, key size enum, and data unit size. However both callers have a struct blk_crypto_key which contains all that information. Thus they both have similar code that converts the blk_crypto_key

[PATCH v12 4/4] fscrypt: add support for hardware-wrapped keys

2025-02-10 Thread Eric Biggers
From: Eric Biggers Add support for hardware-wrapped keys to fscrypt. Such keys are protected from certain attacks, such as cold boot attacks. For more information, see the "Hardware-wrapped keys" section of Documentation/block/inline-encryption.rst. To support hardware-wrapped keys

[PATCH v12 3/4] ufs: qcom: add support for wrapped keys

2025-02-10 Thread Eric Biggers
From: Eric Biggers Wire up the wrapped key support for ufs-qcom by implementing the needed methods in struct blk_crypto_ll_ops and setting the appropriate flag in blk_crypto_profile::key_types_supported. For more information about this feature and how to use it, refer to the sections about

[PATCH v12 2/4] soc: qcom: ice: add HWKM support to the ICE driver

2025-02-10 Thread Eric Biggers
work correctly; dropped unnecessary support for HWKM v1; fixed error handling; improved log messages, comments, and commit message; fixed naming; merged enable and init functions; and other cleanups] Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers --- drivers/mmc/host/sdhci-

[PATCH v12 0/4] Driver and fscrypt support for HW-wrapped inline encryption keys

2025-02-10 Thread Eric Biggers
o HW-wrapped keys could in principle be standardized. - I've reordered the patchset to place preparatory patches that don't depend on the actual HW-wrapped key support first. For older changelogs, see https://lore.kernel.org/r/20241202-wrapped-keys-v7-0-67c3ca3f3...@linaro.org

Re: [PATCH v11 0/7] Support for hardware-wrapped inline encryption keys

2025-02-10 Thread Eric Biggers
Hi Jens, On Mon, Feb 03, 2025 at 10:00:34PM -0800, Eric Biggers wrote: > This is targeting 6.15. As per the suggestion from Jens > (https://lore.kernel.org/linux-block/c3407d1c-6c5c-42ee-b446-ccbab1643...@kernel.dk/), > I'd like patches 1-3 to be queued up into a branch that ge

Re: [PATCH v11 7/7] ufs: qcom: add support for wrapped keys

2025-02-10 Thread Eric Biggers
On Mon, Feb 10, 2025 at 10:14:45AM +0530, Manivannan Sadhasivam wrote: > On Mon, Feb 03, 2025 at 10:00:41PM -0800, Eric Biggers wrote: > > From: Eric Biggers > > > > Wire up the wrapped key support for ufs-qcom by implementing the needed > > methods in struct blk_cr

[PATCH v11 7/7] ufs: qcom: add support for wrapped keys

2025-02-03 Thread Eric Biggers
From: Eric Biggers Wire up the wrapped key support for ufs-qcom by implementing the needed methods in struct blk_crypto_ll_ops and setting the appropriate flag in blk_crypto_profile::key_types_supported. For more information about this feature and how to use it, refer to the sections about

[PATCH v11 6/7] soc: qcom: ice: add HWKM support to the ICE driver

2025-02-03 Thread Eric Biggers
work correctly; dropped unnecessary support for HWKM v1; fixed error handling; improved log messages, comments, and commit message; fixed naming; merged enable and init functions; and other cleanups] Co-developed-by: Eric Biggers Signed-off-by: Eric Biggers --- drivers/mmc/host/sdhci-

[PATCH v11 5/7] soc: qcom: ice: make qcom_ice_program_key() take struct blk_crypto_key

2025-02-03 Thread Eric Biggers
From: Eric Biggers qcom_ice_program_key() currently accepts the key as an array of bytes, algorithm ID, key size enum, and data unit size. However both callers have a struct blk_crypto_key which contains all that information. Thus they both have similar code that converts the blk_crypto_key

[PATCH v11 3/7] blk-crypto: add ioctls to create and prepare hardware-wrapped keys

2025-02-03 Thread Eric Biggers
From: Eric Biggers Until this point, the kernel can use hardware-wrapped keys to do encryption if userspace provides one -- specifically a key in ephemerally-wrapped form. However, no generic way has been provided for userspace to get such a key in the first place. Getting such a key is a two

[PATCH v11 4/7] fscrypt: add support for hardware-wrapped keys

2025-02-03 Thread Eric Biggers
From: Eric Biggers Add support for hardware-wrapped keys to fscrypt. Such keys are protected from certain attacks, such as cold boot attacks. For more information, see the "Hardware-wrapped keys" section of Documentation/block/inline-encryption.rst. To support hardware-wrapped keys

[PATCH v11 2/7] blk-crypto: show supported key types in sysfs

2025-02-03 Thread Eric Biggers
From: Eric Biggers Add sysfs files that indicate which type(s) of keys are supported by the inline encryption hardware associated with a particular request queue: /sys/block/$disk/queue/crypto/hw_wrapped_keys /sys/block/$disk/queue/crypto/raw_keys Userspace can use the presence

[PATCH v11 1/7] blk-crypto: add basic hardware-wrapped key support

2025-02-03 Thread Eric Biggers
From: Eric Biggers To prevent keys from being compromised if an attacker acquires read access to kernel memory, some inline encryption hardware can accept keys which are wrapped by a per-boot hardware-internal key. This avoids needing to keep the raw keys in kernel memory, without limiting the

[PATCH v11 0/7] Support for hardware-wrapped inline encryption keys

2025-02-03 Thread Eric Biggers
- I've reordered the patchset to place preparatory patches that don't depend on the actual HW-wrapped key support first. For older changelogs, see https://lore.kernel.org/r/20241202-wrapped-keys-v7-0-67c3ca3f3...@linaro.org and https://lore.kernel.org/r/20231104211259.17448-1-ebig

Re: [PATCH v10 00/15] Support for hardware-wrapped inline encryption keys

2025-01-10 Thread Eric Biggers
On Fri, Jan 10, 2025 at 09:44:07AM +0100, Bartosz Golaszewski wrote: > On Fri, Dec 13, 2024 at 5:20 AM Eric Biggers wrote: > > > > This patchset is based on next-20241212 and is also available in git via: > > > > git fetch https://git.kernel.org/pub/scm/fs/fscrypt/

Re: [PATCH v10 00/15] Support for hardware-wrapped inline encryption keys

2025-01-02 Thread Eric Biggers
On Thu, Jan 02, 2025 at 01:40:48PM -0500, Martin K. Petersen wrote: > > Eric, > > > This patchset adds support for hardware-wrapped inline encryption > > keys, a security feature supported by some SoCs. It adds the block and > > fscrypt framework for the feature as well as support for it with UFS

Re: [PATCH v10 00/15] Support for hardware-wrapped inline encryption keys

2025-01-02 Thread Eric Biggers
On Thu, Dec 12, 2024 at 08:19:43PM -0800, Eric Biggers wrote: > Maintainers, please consider merging the following preparatory patches for > 6.14: > > - UFS / SCSI tree: patches 1-4 > - MMC tree: patches 5-7 > - Qualcomm / MSM tree: patch 8 Happy new year everyone. We

[PATCH v10 15/15] ufs: qcom: add support for wrapped keys

2024-12-12 Thread Eric Biggers
From: Eric Biggers Wire up the wrapped key support for ufs-qcom by implementing the needed methods in struct blk_crypto_ll_ops and setting the appropriate flags in blk_crypto_profile::key_types_supported. For more information about this feature and how to use it, refer to the sections about

[PATCH v10 11/15] blk-crypto: show supported key types in sysfs

2024-12-12 Thread Eric Biggers
From: Eric Biggers Add sysfs files that indicate which type(s) of keys are supported by the inline encryption hardware associated with a particular request queue: /sys/block/$disk/queue/crypto/hw_wrapped_keys /sys/block/$disk/queue/crypto/raw_keys Userspace can use the presence

[PATCH v10 14/15] soc: qcom: ice: add HWKM support to the ICE driver

2024-12-12 Thread Eric Biggers
[EB: merged related patches, fixed the module parameter to work correctly, fixed error handling, improved log messages, improved comments, improved commit message, fixed various names.] Signed-off-by: Eric Biggers --- drivers/mmc/host/sdhci-msm.c | 5 + drivers/soc/qcom/ice.c

[PATCH v10 13/15] fscrypt: add support for hardware-wrapped keys

2024-12-12 Thread Eric Biggers
From: Eric Biggers Add support for hardware-wrapped keys to fscrypt. Such keys are protected from certain attacks, such as cold boot attacks. For more information, see the "Hardware-wrapped keys" section of Documentation/block/inline-encryption.rst. To support hardware-wrapped keys

[PATCH v10 12/15] blk-crypto: add ioctls to create and prepare hardware-wrapped keys

2024-12-12 Thread Eric Biggers
From: Eric Biggers Until this point, the kernel can use hardware-wrapped keys to do encryption if userspace provides one -- specifically a key in ephemerally-wrapped form. However, no generic way has been provided for userspace to get such a key in the first place. Getting such a key is a two

[PATCH v10 08/15] firmware: qcom: scm: add calls for wrapped key support

2024-12-12 Thread Eric Biggers
ze parameters, fixed qcom_scm_has_wrapped_key_support(), improved comments, improved commit message.] Signed-off-by: Eric Biggers --- drivers/firmware/qcom/qcom_scm.c | 214 + drivers/firmware/qcom/qcom_scm.h | 4 + include/linux/firmware/qcom/qcom_scm.h | 8 +

[PATCH v10 10/15] blk-crypto: add basic hardware-wrapped key support

2024-12-12 Thread Eric Biggers
From: Eric Biggers To prevent keys from being compromised if an attacker acquires read access to kernel memory, some inline encryption hardware can accept keys which are wrapped by a per-boot hardware-internal key. This avoids needing to keep the raw keys in kernel memory, without limiting the

[PATCH v10 07/15] mmc: sdhci-msm: convert to use custom crypto profile

2024-12-12 Thread Eric Biggers
From: Eric Biggers As is being done in ufs-qcom, make the sdhci-msm driver override the full crypto profile rather than "just" key programming and eviction. This makes it much more straightforward to add support for hardware-wrapped inline encryption keys. It also makes it easy t

[PATCH v10 09/15] soc: qcom: ice: make qcom_ice_program_key() take struct blk_crypto_key

2024-12-12 Thread Eric Biggers
From: Eric Biggers qcom_ice_program_key() currently accepts the key as an array of bytes, algorithm ID, key size enum, and data unit size. However both callers have a struct blk_crypto_key which contains all that information. Thus they both have similar code that converts the blk_crypto_key

[PATCH v10 04/15] ufs: crypto: remove ufs_hba_variant_ops::program_key

2024-12-12 Thread Eric Biggers
From: Eric Biggers There are no longer any implementations of ufs_hba_variant_ops::program_key, so remove it. As a result, ufshcd_program_key() no longer can return an error, so also clean it up to return void. Signed-off-by: Eric Biggers --- drivers/ufs/core/ufshcd-crypto.c | 20

[PATCH v10 06/15] mmc: crypto: add mmc_from_crypto_profile()

2024-12-12 Thread Eric Biggers
From: Eric Biggers Add a helper function that encapsulates a container_of expression. For now there is just one user but soon there will be more. Signed-off-by: Eric Biggers --- drivers/mmc/host/cqhci-crypto.c | 5 + include/linux/mmc/host.h| 8 2 files changed, 9

[PATCH v10 05/15] mmc: sdhci-msm: fix crypto key eviction

2024-12-12 Thread Eric Biggers
From: Eric Biggers Commit c7eed31e235c ("mmc: sdhci-msm: Switch to the new ICE API") introduced an incorrect check of the algorithm ID into the key eviction path, and thus qcom_ice_evict_key() is no longer ever called. Fix it. Fixes: c7eed31e235c ("mmc: sdhci-msm: Switch to

[PATCH v10 03/15] ufs: qcom: convert to use UFSHCD_QUIRK_CUSTOM_CRYPTO_PROFILE

2024-12-12 Thread Eric Biggers
From: Eric Biggers By default the UFS core is responsible for initializing the blk_crypto_profile, but Qualcomm platforms have their own way of programming and evicting crypto keys. So currently ufs_hba_variant_ops::program_key is used to redirect control flow from ufshcd_program_key(). This

[PATCH v10 02/15] ufs: crypto: add ufs_hba_from_crypto_profile()

2024-12-12 Thread Eric Biggers
From: Eric Biggers Add a helper function that encapsulates a container_of expression. For now there are two users but soon there will be more. Tested-by: Bartosz Golaszewski # sm8650 Signed-off-by: Eric Biggers --- drivers/ufs/core/ufshcd-crypto.c | 6 ++ include/ufs/ufshcd.h

[PATCH v10 01/15] ufs: qcom: fix crypto key eviction

2024-12-12 Thread Eric Biggers
From: Eric Biggers Commit 56541c7c4468 ("scsi: ufs: ufs-qcom: Switch to the new ICE API") introduced an incorrect check of the algorithm ID into the key eviction path, and thus qcom_ice_evict_key() is no longer ever called. Fix it. Fixes: 56541c7c4468 ("scsi: ufs: ufs-qcom: Sw

[PATCH v10 00/15] Support for hardware-wrapped inline encryption keys

2024-12-12 Thread Eric Biggers
on the actual HW-wrapped key support first. For older changelogs, see https://lore.kernel.org/r/20241202-wrapped-keys-v7-0-67c3ca3f3...@linaro.org and https://lore.kernel.org/r/20231104211259.17448-1-ebigg...@kernel.org Eric Biggers (13): ufs: qcom: fix crypto key eviction ufs: crypto: add ufs_hba_from

Re: [PATCH v9 00/12] Support for hardware-wrapped inline encryption keys

2024-12-09 Thread Eric Biggers
On Mon, Dec 09, 2024 at 02:35:29PM -0600, Bartosz Golaszewski wrote: > On Mon, 9 Dec 2024 21:15:16 +0100, Eric Biggers said: > > On Mon, Dec 09, 2024 at 04:00:18PM +0100, Bartosz Golaszewski wrote: > >> > >> I haven't gotten to the bottom of this yet but the >

Re: [PATCH v9 00/12] Support for hardware-wrapped inline encryption keys

2024-12-09 Thread Eric Biggers
On Mon, Dec 09, 2024 at 04:00:18PM +0100, Bartosz Golaszewski wrote: > > I haven't gotten to the bottom of this yet but the > FS_IOC_ADD_ENCRYPTION_KEY ioctl doesn't work due to the SCM call > returning EINVAL. Just FYI. I'm still figuring out what's wrong. > > Bart > Can you try the following?

[PATCH v9 11/12] soc: qcom: ice: add HWKM support to the ICE driver

2024-12-08 Thread Eric Biggers
[EB: merged related patches, fixed the module parameter to work correctly, fixed error handling, improved log messages, improved comments, improved commit message, fixed various names.] Signed-off-by: Eric Biggers --- drivers/mmc/host/sdhci-msm.c | 5 + drivers/soc/qcom/ice.c

[PATCH v9 12/12] ufs: qcom: add support for wrapped keys

2024-12-08 Thread Eric Biggers
From: Eric Biggers Wire up the wrapped key support for ufs-qcom by implementing the needed methods in struct blk_crypto_ll_ops and setting the appropriate flags in blk_crypto_profile::key_types_supported. For more information about this feature and how to use it, refer to the sections about

[PATCH v9 10/12] fscrypt: add support for hardware-wrapped keys

2024-12-08 Thread Eric Biggers
From: Eric Biggers Add support for hardware-wrapped keys to fscrypt. Such keys are protected from certain attacks, such as cold boot attacks. For more information, see the "Hardware-wrapped keys" section of Documentation/block/inline-encryption.rst. To support hardware-wrapped keys

[PATCH v9 09/12] blk-crypto: add ioctls to create and prepare hardware-wrapped keys

2024-12-08 Thread Eric Biggers
From: Eric Biggers Until this point, the kernel can use hardware-wrapped keys to do encryption if userspace provides one -- specifically a key in ephemerally-wrapped form. However, no generic way has been provided for userspace to get such a key in the first place. Getting such a key is a two

[PATCH v9 08/12] blk-crypto: show supported key types in sysfs

2024-12-08 Thread Eric Biggers
From: Eric Biggers Add sysfs files that indicate which type(s) of keys are supported by the inline encryption hardware associated with a particular request queue: /sys/block/$disk/queue/crypto/hw_wrapped_keys /sys/block/$disk/queue/crypto/raw_keys Userspace can use the presence

[PATCH v9 07/12] blk-crypto: add basic hardware-wrapped key support

2024-12-08 Thread Eric Biggers
From: Eric Biggers To prevent keys from being compromised if an attacker acquires read access to kernel memory, some inline encryption hardware can accept keys which are wrapped by a per-boot hardware-internal key. This avoids needing to keep the raw keys in kernel memory, without limiting the

[PATCH v9 06/12] soc: qcom: ice: make qcom_ice_program_key() take struct blk_crypto_key

2024-12-08 Thread Eric Biggers
From: Eric Biggers qcom_ice_program_key() currently accepts the key as an array of bytes, algorithm ID, key size enum, and data unit size. However both callers have a struct blk_crypto_key which contains all that information. Thus they both have similar code that converts the blk_crypto_key

[PATCH v9 05/12] firmware: qcom: scm: add calls for wrapped key support

2024-12-08 Thread Eric Biggers
ze parameters, fixed qcom_scm_has_wrapped_key_support(), improved comments, improved commit message.] Signed-off-by: Eric Biggers --- drivers/firmware/qcom/qcom_scm.c | 214 + drivers/firmware/qcom/qcom_scm.h | 4 + include/linux/firmware/qcom/qcom_scm.h | 8 +

[PATCH v9 04/12] mmc: sdhci-msm: convert to use custom crypto profile

2024-12-08 Thread Eric Biggers
From: Eric Biggers As is being done in ufs-qcom, make the sdhci-msm driver override the full crypto profile rather than "just" key programming and eviction. This makes it much more straightforward to add support for hardware-wrapped inline encryption keys. It also makes it easy t

[PATCH v9 02/12] ufs: qcom: convert to use UFSHCD_QUIRK_CUSTOM_CRYPTO_PROFILE

2024-12-08 Thread Eric Biggers
From: Eric Biggers By default the UFS core is responsible for initializing the blk_crypto_profile, but Qualcomm platforms have their own way of programming and evicting crypto keys. So currently ufs_hba_variant_ops::program_key is used to redirect control flow from ufshcd_program_key(). This

[PATCH v9 03/12] mmc: crypto: add mmc_from_crypto_profile()

2024-12-08 Thread Eric Biggers
From: Eric Biggers Add a helper function that encapsulates a container_of expression. For now there is just one user but soon there will be more. Signed-off-by: Eric Biggers --- drivers/mmc/host/cqhci-crypto.c | 5 + include/linux/mmc/host.h| 8 2 files changed, 9

[PATCH v9 01/12] ufs: crypto: add ufs_hba_from_crypto_profile()

2024-12-08 Thread Eric Biggers
From: Eric Biggers Add a helper function that encapsulates a container_of expression. For now there are two users but soon there will be more. Signed-off-by: Eric Biggers --- drivers/ufs/core/ufshcd-crypto.c | 6 ++ include/ufs/ufshcd.h | 8 2 files changed, 10

[PATCH v9 00/12] Support for hardware-wrapped inline encryption keys

2024-12-08 Thread Eric Biggers
tl and tests via xfstests (I have some old patches for this that need to be updated). Eric Biggers (10): ufs: crypto: add ufs_hba_from_crypto_profile() ufs: qcom: convert to use UFSHCD_QUIRK_CUSTOM_CRYPTO_PROFILE mmc: crypto: add mmc_from_crypto_profile() mmc: sdhci-msm: convert to use cust

[RFC PATCH v8 2/4] blk-crypto: show supported key types in sysfs

2023-11-04 Thread Eric Biggers
From: Eric Biggers Add sysfs files that indicate which type(s) of keys are supported by the inline encryption hardware associated with a particular request queue: /sys/block/$disk/queue/crypto/hw_wrapped_keys /sys/block/$disk/queue/crypto/standard_keys Userspace can use the

[RFC PATCH v8 4/4] fscrypt: add support for hardware-wrapped keys

2023-11-04 Thread Eric Biggers
From: Eric Biggers Add support for hardware-wrapped keys to fscrypt. Such keys are protected from certain attacks, such as cold boot attacks. For more information, see the "Hardware-wrapped keys" section of Documentation/block/inline-encryption.rst. To support hardware-wrapped keys

[RFC PATCH v8 1/4] blk-crypto: add basic hardware-wrapped key support

2023-11-04 Thread Eric Biggers
From: Eric Biggers To prevent keys from being compromised if an attacker acquires read access to kernel memory, some inline encryption hardware can accept keys which are wrapped by a per-boot hardware-internal key. This avoids needing to keep the raw keys in kernel memory, without limiting the

[RFC PATCH v8 3/4] blk-crypto: add ioctls to create and prepare hardware-wrapped keys

2023-11-04 Thread Eric Biggers
From: Eric Biggers Until this point, the kernel can use hardware-wrapped keys to do encryption if userspace provides one -- specifically a key in ephemerally-wrapped form. However, no generic way has been provided for userspace to get such a key in the first place. Getting such a key is a two

[RFC PATCH v8 0/4] Support for hardware-wrapped inline encryption keys

2023-11-04 Thread Eric Biggers
and fscrypt branches. - Minor cleanups. Changes in v2: - Added new ioctls for creating and preparing hardware-wrapped keys. - Rebased onto my patchset which renames blk_keyslot_manager to blk_crypto_profile. Eric Biggers (4): blk-crypto: add basic hardware-wrapped key support

Re: INFO: task hung in nbd_ioctl

2019-10-17 Thread Eric Biggers
On Thu, Oct 17, 2019 at 05:28:29PM +0100, Richard W.M. Jones wrote: > On Thu, Oct 17, 2019 at 10:47:59AM -0500, Mike Christie wrote: > > On 10/17/2019 09:03 AM, Richard W.M. Jones wrote: > > > On Tue, Oct 01, 2019 at 04:19:25PM -0500, Mike Christie wrote: > > >> Hey Josef and nbd list, > > >> > > >

Re: WARNING in blk_mq_init_sched

2019-09-27 Thread Eric Biggers
On Wed, Sep 25, 2019 at 10:13:30PM +, Damien Le Moal wrote: > On 2019/09/25 10:56, Damien Le Moal wrote: > > On 2019/09/25 9:56, syzbot wrote: > >> Hello, > >> > >> syzbot found the following crash on: > >> > >> HEAD commit:f7c3bf8f Merge tag 'gfs2-for-5.4' of > >> git://git.kernel.org/..

Re: [PATCH v4 7/8] fscrypt: wire up fscrypt to use blk-crypto

2019-08-27 Thread Eric Biggers
On Wed, Aug 21, 2019 at 12:57:13AM -0700, Satya Tangirala wrote: > Introduce fscrypt_set_bio_crypt_ctx for filesystems to call to set up > encryption contexts in bios, and fscrypt_evict_crypt_key to evict > the encryption context associated with an inode. > > Inline encryption is controlled by a p

Re: [PATCH v4 5/8] scsi: ufs: UFS crypto API

2019-08-27 Thread Eric Biggers
On Wed, Aug 21, 2019 at 12:57:11AM -0700, Satya Tangirala wrote: > +static int ufshcd_crypto_cap_find(void *hba_p, > +enum blk_crypto_mode_num crypto_mode, > +unsigned int data_unit_size) > +{ > + struct ufs_hba *hba = hba_p; > + enum ufs_cryp

Re: [PATCH v4 3/8] block: blk-crypto for Inline Encryption

2019-08-27 Thread Eric Biggers
On Wed, Aug 21, 2019 at 12:57:09AM -0700, Satya Tangirala wrote: > diff --git a/block/blk-crypto.c b/block/blk-crypto.c > new file mode 100644 > index ..c8f06264a0f5 > --- /dev/null > +++ b/block/blk-crypto.c > @@ -0,0 +1,737 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyrig

Re: [PATCH v4 1/8] block: Keyslot Manager for Inline Encryption

2019-08-27 Thread Eric Biggers
Hi Satya, a few more minor comments: On Wed, Aug 21, 2019 at 12:57:07AM -0700, Satya Tangirala wrote: > +/** > + * keyslot_manager_create() - Create a keyslot manager > + * @num_slots: The number of key slots to manage. > + * @ksm_ll_ops: The struct keyslot_mgmt_ll_ops for the device that this >

Reminder: 11 open syzbot bugs in block subsystem

2019-07-23 Thread Eric Biggers
[This email was generated by a script. Let me know if you have any suggestions to make it better, or if you want it re-generated with the latest status.] Of the currently open syzbot reports against the upstream kernel, I've manually marked 11 of them as possibly being bugs in the block subsystem

Re: [PATCH 3/8] block: blk-crypto for Inline Encryption

2019-07-15 Thread Eric Biggers
Hi Satya, here's yet another round of comments. I'd really like for people who are experts in the block layer to review this too, though. The integration into the block layer needs more review. On Wed, Jul 10, 2019 at 03:56:04PM -0700, Satya Tangirala wrote: > We introduce blk-crypto, which manag

Re: [PATCH 7/8] fscrypt: wire up fscrypt to use blk-crypto

2019-07-12 Thread Eric Biggers
Hi Satya, On Wed, Jul 10, 2019 at 03:56:08PM -0700, Satya Tangirala wrote: > Introduce fscrypt_set_bio_crypt_ctx for filesystems to call to set up > encryption contexts in bios, and fscrypt_evict_crypt_key to evict > the encryption context associated with an inode. > > Inline encryption is contro

Re: INFO: task hung in io_uring_release

2019-07-01 Thread Eric Biggers
Jens, any idea about this? On Mon, Jun 24, 2019 at 01:21:06AM -0700, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:bed3c0d8 Merge tag 'for-5.2-rc5-tag' of git://git.kernel.o.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.t

Reminder: 11 open syzbot bugs in block subsystem

2019-06-24 Thread Eric Biggers
[This email was generated by a script. Let me know if you have any suggestions to make it better.] Of the currently open syzbot reports against the upstream kernel, I've manually marked 11 of them as possibly being bugs in the block subsystem. I've listed these reports below, sorted by an algori

Re: [RFC PATCH v2 7/8] fscrypt: wire up fscrypt to use blk-crypto

2019-06-13 Thread Eric Biggers
Hi Satya, On Wed, Jun 05, 2019 at 04:28:36PM -0700, Satya Tangirala wrote: > Introduce fscrypt_set_bio_crypt_ctx for filesystems to call to set up > encryption contexts in bios, and fscrypt_evict_crypt_key to evict > the encryption context associated with an inode. > > Inline encryption is contro

Re: [RFC PATCH v2 6/8] scsi: ufs: Add inline encryption support to UFS

2019-06-13 Thread Eric Biggers
On Wed, Jun 05, 2019 at 04:28:35PM -0700, Satya Tangirala wrote: > +static inline int ufshcd_prepare_lrbp_crypto(struct ufs_hba *hba, > + struct scsi_cmnd *cmd, > + struct ufshcd_lrb *lrbp) > +{ > + int key_slot;

[PATCH] io_uring: fix memory leak of UNIX domain socket inode

2019-06-13 Thread Eric Biggers
From: Eric Biggers Opening and closing an io_uring instance leaks a UNIX domain socket inode. This is because the ->file of the io_uring instance's internal UNIX domain socket is set to point to the io_uring file, but then sock_release() sees the non-NULL ->file and assumes the inod

Re: [RFC PATCH v2 5/8] scsi: ufs: UFS crypto API

2019-06-13 Thread Eric Biggers
Hi Satya, On Wed, Jun 05, 2019 at 04:28:34PM -0700, Satya Tangirala wrote: > Introduce functions to manipulate UFS inline encryption hardware > in line with the JEDEC UFSHCI v2.1 specification and to work with the > block keyslot manager. > > Signed-off-by: Satya Tangirala > --- > drivers/scsi/

Re: [RFC PATCH v2 3/8] block: blk-crypto for Inline Encryption

2019-06-13 Thread Eric Biggers
On Wed, Jun 05, 2019 at 04:28:32PM -0700, Satya Tangirala wrote: > We introduce blk-crypto, which manages programming keyslots for struct > bios. With blk-crypto, filesystems only need to call bio_crypt_set_ctx with > the encryption key, algorithm and data_unit_num; they don't have to worry > about

Re: [RFC PATCH v2 1/8] block: Keyslot Manager for Inline Encryption

2019-06-12 Thread Eric Biggers
On Wed, Jun 05, 2019 at 04:28:30PM -0700, Satya Tangirala wrote: > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 592669bcc536..f76d5dff27fe 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -385,6 +385,10 @@ static inline int blkdev_reset_zones_ioctl(s

Re: [RFC PATCH v2 2/8] block: Add encryption context to struct bio

2019-06-12 Thread Eric Biggers
Hi Satya, On Wed, Jun 05, 2019 at 04:28:31PM -0700, Satya Tangirala wrote: > We must have some way of letting a storage device driver know what > encryption context it should use for en/decrypting a request. However, > it's the filesystem/fscrypt that knows about and manages encryption > contexts.

Re: [RFC PATCH v2 1/8] block: Keyslot Manager for Inline Encryption

2019-06-07 Thread Eric Biggers
Hi Satya, On Wed, Jun 05, 2019 at 04:28:30PM -0700, Satya Tangirala wrote: > > Known issues: > 1) Keyslot Manager has a performance bug where the same encryption >context may be programmed into multiple keyslots at the same time in >certain situations when all keyslots are being used. Th

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-25 Thread Eric Biggers
Hi Jens, On Thu, Feb 21, 2019 at 10:45:27AM -0700, Jens Axboe wrote: > On 2/20/19 3:58 PM, Ming Lei wrote: > > On Mon, Feb 11, 2019 at 12:00:41PM -0700, Jens Axboe wrote: > >> For an ITER_BVEC, we can just iterate the iov and add the pages > >> to the bio directly. This requires that the caller do

Re: [PATCH 2/2] scsi: ufs: add inline crypto support to UFS HCD

2018-12-11 Thread Eric Biggers
[+Cc other people who have been working on this] Hi Parshuram, On Tue, Dec 11, 2018 at 09:50:27AM +, Parshuram Thombare wrote: > Add real time crypto support to UFS HCD using new device > mapper 'crypto-ufs'. dmsetup tool can be used to enable > real time / inline crypto support using device

[PATCH] block: make blk_try_req_merge() static

2018-11-14 Thread Eric Biggers
From: Eric Biggers blk_try_req_merge() is only used in block/blk-merge.c, so make it static. This addresses a gcc warning when -Wmissing-prototypes is enabled. Signed-off-by: Eric Biggers --- block/blk-merge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk

Re: KASAN: use-after-free Read in disk_unblock_events

2018-04-08 Thread Eric Biggers
On Mon, 30 Oct 2017 12:32:58 -0700, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 36ef71cae353f88fd6e095e2aaa3e5953af1685d > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console outpu

Re: [PATCH] blktrace_api.h: fix comment for struct blk_user_trace_setup

2018-02-26 Thread Eric Biggers
On Fri, Jan 26, 2018 at 04:58:06PM -0800, Eric Biggers wrote: > From: Eric Biggers > > 'struct blk_user_trace_setup' is passed to BLKTRACESETUP, not > BLKTRACESTART. > > Signed-off-by: Eric Biggers > --- > include/uapi/linux/blktrace_api.h | 2 +- > 1 fil

Re: blkdev loop UAF

2018-02-01 Thread Eric Biggers
On Thu, Jan 11, 2018 at 06:00:08PM +0100, Jan Kara wrote: > On Thu 11-01-18 19:22:39, Hou Tao wrote: > > Hi, > > > > On 2018/1/11 16:24, Dan Carpenter wrote: > > > Thanks for your report and the patch. I am sending it to the > > > linux-block devs since it's already public. > > > > > > regards,

Re: BUG: unable to handle kernel NULL pointer dereference in blk_throtl_update_limit_valid

2018-01-30 Thread Eric Biggers
On Tue, Dec 19, 2017 at 06:42:00AM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 6084b576dca2e898f5c101baef151f7bfdbb606d > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console o

[PATCH] blktrace_api.h: fix comment for struct blk_user_trace_setup

2018-01-26 Thread Eric Biggers
From: Eric Biggers 'struct blk_user_trace_setup' is passed to BLKTRACESETUP, not BLKTRACESTART. Signed-off-by: Eric Biggers --- include/uapi/linux/blktrace_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/blktrace_api.h b/include/

[PATCH] Revert "kernel/relay.c: fix potential memory leak"

2018-01-26 Thread Eric Biggers
From: Eric Biggers This reverts commit ba62bafe942b159a6109cbec780d36496e06b6c5. This commit introduced a double free bug, because 'chan' is already freed by the line: kref_put(&chan->kref, relay_destroy_channel); This bug was found by syzkaller, using the BLKTRACESE

Re: WARNING in kmalloc_slab (3)

2017-12-12 Thread Eric Biggers
On Mon, Dec 04, 2017 at 12:26:32PM +0300, Dan Carpenter wrote: > On Mon, Dec 04, 2017 at 09:18:05AM +0100, Dmitry Vyukov wrote: > > On Mon, Dec 4, 2017 at 9:14 AM, Dan Carpenter > > wrote: > > > On Sun, Dec 03, 2017 at 12:16:08PM -0800, Eric Biggers wrote: > > >&

Re: possible deadlock in blk_trace_remove

2017-12-03 Thread Eric Biggers
On Sun, Dec 03, 2017 at 05:24:32PM -0700, Jens Axboe wrote: > On 12/03/2017 01:24 PM, Eric Biggers wrote: > > On Sun, Nov 19, 2017 at 02:36:01AM -0800, syzbot wrote: > >> Hello, > >> > >> syzkaller hit the following crash on > >> d9e0e63d9a6f88440eb20

Re: possible deadlock in blk_trace_remove

2017-12-03 Thread Eric Biggers
On Sun, Nov 19, 2017 at 02:36:01AM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > d9e0e63d9a6f88440eb201e1491fcf730272c706 > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console o

Re: WARNING in kmalloc_slab (3)

2017-12-03 Thread Eric Biggers
+Cc linux-block On Sun, Dec 03, 2017 at 06:25:01AM -0800, syzbot wrote: > WARNING: CPU: 0 PID: 3081 at mm/slab_common.c:971 kmalloc_slab+0x5d/0x70 > mm/slab_common.c:971 > Kernel panic - not syncing: panic_on_warn set ... > [...] > __do_kmalloc mm/slab.c:3706 [inline] > __kmalloc+0x25/0x760 mm/

Re: possible deadlock in blkdev_reread_part

2017-11-05 Thread Eric Biggers
On Wed, Nov 01, 2017 at 10:02:44PM +0300, 'Dmitry Vyukov' via syzkaller-bugs wrote: > > Still happens on linux-next 36ef71cae353f88fd6e095e2aaa3e5953af1685d (Oct 20). > Note repro needs to be compiled with -m32 > > [ 243.819514] == > [ 243.82

[PATCH] elevator: fix truncation of icq_cache_name

2017-06-02 Thread Eric Biggers
From: Eric Biggers gcc 7.1 reports the following warning: block/elevator.c: In function ‘elv_register’: block/elevator.c:898:5: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] "%s_io_cq", e->

Re: [PATCH 0/5] v2: block subsystem refcounter conversions

2017-04-21 Thread Eric Biggers
Hi Elena, On Fri, Apr 21, 2017 at 10:55:29AM +, Reshetova, Elena wrote: > > > > At the very least, what is there now could probably be made about twice as > > fast > > by removing the checks that don't actually help mitigate refcount overflow > > bugs, > > specifically all the checks in ref

Re: [PATCH 0/5] v2: block subsystem refcounter conversions

2017-04-20 Thread Eric Biggers
Hi Elena, On Thu, Apr 20, 2017 at 04:10:16PM +, Reshetova, Elena wrote: > > > All the objections from DaveM on the amount of cycles spent on the > > new refcount_t apply to the block layer fast path operations as well. > > Ok, could you please indicate the correct way to measure the impact f

[PATCH] blk-mq: constify struct blk_mq_ops

2017-03-30 Thread Eric Biggers
From: Eric Biggers Constify all instances of blk_mq_ops, as they are never modified. Signed-off-by: Eric Biggers --- drivers/block/loop.c | 2 +- drivers/block/mtip32xx/mtip32xx.c | 2 +- drivers/block/nbd.c | 2 +- drivers/block/null_blk.c | 2 +- drivers

[PATCH] fs: remove _submit_bh()

2017-03-25 Thread Eric Biggers
From: Eric Biggers _submit_bh() allowed submitting a buffer_head for I/O using custom bio_flags. It used to be used by jbd to set BIO_SNAP_STABLE, introduced by commit 713685111774 ("mm: make snapshotting pages for stable writes a per-bio operation"). However, the code and flag has

[PATCH] block: constify struct blk_integrity_profile

2017-03-24 Thread Eric Biggers
From: Eric Biggers blk_integrity_profile's are never modified, so mark them 'const' so that they are placed in .rodata and benefit from memory protection. Signed-off-by: Eric Biggers --- block/blk-integrity.c | 2 +- block/t10-pi.c | 8 include/linu

Re: [PATCH] block: remove outdated part of blkdev_issue_flush() comment

2017-03-24 Thread Eric Biggers
On Mon, Jan 23, 2017 at 11:43:21AM -0800, Eric Biggers wrote: > From: Eric Biggers > > blkdev_issue_flush() is now always synchronous, and it no longer has a > flags argument. So remove the part of the comment about the WAIT flag. > > Signed-off-by: Eric Biggers > --- >

Re: [PATCH] block: correct documentation for blkdev_issue_discard() flags

2017-03-24 Thread Eric Biggers
On Mon, Jan 23, 2017 at 11:41:39AM -0800, Eric Biggers wrote: > From: Eric Biggers > > BLKDEV_IFL_* flags no longer exist; blkdev_issue_discard() now actually > takes BLKDEV_DISCARD_* flags. > > Signed-off-by: Eric Biggers > --- > block/blk-lib.c | 2 +- > 1 file

[PATCH] block: remove outdated part of blkdev_issue_flush() comment

2017-01-23 Thread Eric Biggers
From: Eric Biggers blkdev_issue_flush() is now always synchronous, and it no longer has a flags argument. So remove the part of the comment about the WAIT flag. Signed-off-by: Eric Biggers --- block/blk-flush.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk

[PATCH] block: correct documentation for blkdev_issue_discard() flags

2017-01-23 Thread Eric Biggers
From: Eric Biggers BLKDEV_IFL_* flags no longer exist; blkdev_issue_discard() now actually takes BLKDEV_DISCARD_* flags. Signed-off-by: Eric Biggers --- block/blk-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index ed89c8f4b2a0