aosp/android-mainline: update series (rebase onto v6.1-3618-gce8a79d5601aa)

up to 82c4e09b2e0a8 ("Merge ce8a79d5601a ("Merge tag 'for-6.2/block-2022-12-08' of git://git.kernel.dk/linux") into android-mainline")

Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ice9e3e223df6a91651432518c99a2df4da288ac3
diff --git a/android-mainline/ANDROID-block-add-basic-hardware-wrapped-key-support.patch b/android-mainline/ANDROID-block-add-basic-hardware-wrapped-key-support.patch
index 868b610..801a305 100644
--- a/android-mainline/ANDROID-block-add-basic-hardware-wrapped-key-support.patch
+++ b/android-mainline/ANDROID-block-add-basic-hardware-wrapped-key-support.patch
@@ -36,18 +36,18 @@
 Signed-off-by: Eric Biggers <ebiggers@google.com>
 Signed-off-by: Lee Jones <joneslee@google.com>
 ---
- Documentation/block/inline-encryption.rst | 233 +++++++++++++++++++++-
+ Documentation/block/inline-encryption.rst | 221 +++++++++++++++++++++-
  block/blk-crypto-fallback.c               |   5 +-
- block/blk-crypto-internal.h               |  13 ++
- block/blk-crypto-profile.c                |  63 ++++++
- block/blk-crypto.c                        |  85 +++++---
- drivers/md/dm-table.c                     |   3 +-
+ block/blk-crypto-internal.h               |   1 +
+ block/blk-crypto-profile.c                |  62 ++++++
+ block/blk-crypto.c                        |  50 ++++-
+ drivers/md/dm-table.c                     |   1 +
  drivers/mmc/host/cqhci-crypto.c           |   2 +
  drivers/ufs/core/ufshcd-crypto.c          |   1 +
- fs/crypto/inline_crypt.c                  |  17 +-
- include/linux/blk-crypto-profile.h        |  32 +--
- include/linux/blk-crypto.h                |  90 +++++++--
- 11 files changed, 471 insertions(+), 73 deletions(-)
+ fs/crypto/inline_crypt.c                  |   3 +-
+ include/linux/blk-crypto-profile.h        |  20 ++
+ include/linux/blk-crypto.h                |  77 +++++++-
+ 11 files changed, 419 insertions(+), 24 deletions(-)
 
 diff --git a/Documentation/block/inline-encryption.rst b/Documentation/block/inline-encryption.rst
 --- a/Documentation/block/inline-encryption.rst
@@ -67,54 +67,6 @@
  
  We introduce ``struct bio_crypt_ctx`` to represent an encryption context.  It
  contains a data unit number and a pointer to a blk_crypto_key.  We add pointers
-@@ -142,7 +142,7 @@ Therefore, we also introduce *blk-crypto-fallback*, which is an implementation
- of inline encryption using the kernel crypto API.  blk-crypto-fallback is built
- into the block layer, so it works on any block device without any special setup.
- Essentially, when a bio with an encryption context is submitted to a
--request_queue that doesn't support that encryption context, the block layer will
-+block_device that doesn't support that encryption context, the block layer will
- handle en/decryption of the bio using blk-crypto-fallback.
- 
- For encryption, the data cannot be encrypted in-place, as callers usually rely
-@@ -187,7 +187,7 @@ API presented to users of the block layer
- 
- ``blk_crypto_config_supported()`` allows users to check ahead of time whether
- inline encryption with particular crypto settings will work on a particular
--request_queue -- either via hardware or via blk-crypto-fallback.  This function
-+block_device -- either via hardware or via blk-crypto-fallback.  This function
- takes in a ``struct blk_crypto_config`` which is like blk_crypto_key, but omits
- the actual bytes of the key and instead just contains the algorithm, data unit
- size, etc.  This function can be useful if blk-crypto-fallback is disabled.
-@@ -195,7 +195,7 @@ size, etc.  This function can be useful if blk-crypto-fallback is disabled.
- ``blk_crypto_init_key()`` allows users to initialize a blk_crypto_key.
- 
- Users must call ``blk_crypto_start_using_key()`` before actually starting to use
--a blk_crypto_key on a request_queue (even if ``blk_crypto_config_supported()``
-+a blk_crypto_key on a block_device (even if ``blk_crypto_config_supported()``
- was called earlier).  This is needed to initialize blk-crypto-fallback if it
- will be needed.  This must not be called from the data path, as this may have to
- allocate resources, which may deadlock in that case.
-@@ -207,7 +207,7 @@ for en/decryption.  Users don't need to worry about freeing the bio_crypt_ctx
- later, as that happens automatically when the bio is freed or reset.
- 
- Finally, when done using inline encryption with a blk_crypto_key on a
--request_queue, users must call ``blk_crypto_evict_key()``.  This ensures that
-+block_device, users must call ``blk_crypto_evict_key()``.  This ensures that
- the key is evicted from all keyslots it may be programmed into and unlinked from
- any kernel data structures it may be linked into.
- 
-@@ -221,9 +221,9 @@ as follows:
- 5. ``blk_crypto_evict_key()`` (after all I/O has completed)
- 6. Zeroize the blk_crypto_key (this has no dedicated function)
- 
--If a blk_crypto_key is being used on multiple request_queues, then
-+If a blk_crypto_key is being used on multiple block_devices, then
- ``blk_crypto_config_supported()`` (if used), ``blk_crypto_start_using_key()``,
--and ``blk_crypto_evict_key()`` must be called on each request_queue.
-+and ``blk_crypto_evict_key()`` must be called on each block_device.
- 
- API presented to device drivers
- ===============================
 @@ -302,3 +302,216 @@ kernel will pretend that the device does not support hardware inline encryption
  When the crypto API fallback is enabled, this means that all bios with and
  encryption context will use the fallback, and IO will complete as usual.  When
@@ -372,37 +324,10 @@
  	unsigned int ivsize; /* iv size in bytes */
  };
  
-@@ -65,6 +66,18 @@ static inline bool blk_crypto_rq_is_encrypted(struct request *rq)
- 	return rq->crypt_ctx;
- }
- 
-+blk_status_t blk_crypto_get_keyslot(struct blk_crypto_profile *profile,
-+				    const struct blk_crypto_key *key,
-+				    struct blk_crypto_keyslot **slot_ptr);
-+
-+void blk_crypto_put_keyslot(struct blk_crypto_keyslot *slot);
-+
-+int __blk_crypto_evict_key(struct blk_crypto_profile *profile,
-+			   const struct blk_crypto_key *key);
-+
-+bool __blk_crypto_cfg_supported(struct blk_crypto_profile *profile,
-+				const struct blk_crypto_config *cfg);
-+
- #else /* CONFIG_BLK_INLINE_ENCRYPTION */
- 
- static inline int blk_crypto_sysfs_register(struct request_queue *q)
 diff --git a/block/blk-crypto-profile.c b/block/blk-crypto-profile.c
 --- a/block/blk-crypto-profile.c
 +++ b/block/blk-crypto-profile.c
-@@ -32,6 +32,7 @@
- #include <linux/wait.h>
- #include <linux/blkdev.h>
- #include <linux/blk-integrity.h>
-+#include "blk-crypto-internal.h"
- 
- struct blk_crypto_keyslot {
- 	atomic_t slot_refs;
-@@ -350,6 +351,8 @@ bool __blk_crypto_cfg_supported(struct blk_crypto_profile *profile,
+@@ -351,6 +351,8 @@ bool __blk_crypto_cfg_supported(struct blk_crypto_profile *profile,
  		return false;
  	if (profile->max_dun_bytes_supported < cfg->dun_bytes)
  		return false;
@@ -411,7 +336,7 @@
  	return true;
  }
  
-@@ -463,6 +466,60 @@ bool blk_crypto_register(struct blk_crypto_profile *profile,
+@@ -464,6 +466,60 @@ bool blk_crypto_register(struct blk_crypto_profile *profile,
  }
  EXPORT_SYMBOL_GPL(blk_crypto_register);
  
@@ -472,7 +397,7 @@
  /**
   * blk_crypto_intersect_capabilities() - restrict supported crypto capabilities
   *					 by child device
-@@ -486,10 +543,12 @@ void blk_crypto_intersect_capabilities(struct blk_crypto_profile *parent,
+@@ -487,10 +543,12 @@ void blk_crypto_intersect_capabilities(struct blk_crypto_profile *parent,
  			    child->max_dun_bytes_supported);
  		for (i = 0; i < ARRAY_SIZE(child->modes_supported); i++)
  			parent->modes_supported[i] &= child->modes_supported[i];
@@ -485,7 +410,7 @@
  	}
  }
  EXPORT_SYMBOL_GPL(blk_crypto_intersect_capabilities);
-@@ -522,6 +581,9 @@ bool blk_crypto_has_capabilities(const struct blk_crypto_profile *target,
+@@ -523,6 +581,9 @@ bool blk_crypto_has_capabilities(const struct blk_crypto_profile *target,
  	    target->max_dun_bytes_supported)
  		return false;
  
@@ -495,7 +420,7 @@
  	return true;
  }
  EXPORT_SYMBOL_GPL(blk_crypto_has_capabilities);
-@@ -556,5 +618,6 @@ void blk_crypto_update_capabilities(struct blk_crypto_profile *dst,
+@@ -557,5 +618,6 @@ void blk_crypto_update_capabilities(struct blk_crypto_profile *dst,
  	       sizeof(dst->modes_supported));
  
  	dst->max_dun_bytes_supported = src->max_dun_bytes_supported;
@@ -545,28 +470,7 @@
  		BUG_ON(blk_crypto_modes[i].ivsize > BLK_CRYPTO_MAX_IV_SIZE);
  	}
  
-@@ -273,7 +282,6 @@ bool __blk_crypto_bio_prep(struct bio **bio_ptr)
- {
- 	struct bio *bio = *bio_ptr;
- 	const struct blk_crypto_key *bc_key = bio->bi_crypt_context->bc_key;
--	struct blk_crypto_profile *profile;
- 
- 	/* Error if bio has no data. */
- 	if (WARN_ON_ONCE(!bio_has_data(bio))) {
-@@ -290,10 +298,9 @@ bool __blk_crypto_bio_prep(struct bio **bio_ptr)
- 	 * Success if device supports the encryption context, or if we succeeded
- 	 * in falling back to the crypto API.
- 	 */
--	profile = bdev_get_queue(bio->bi_bdev)->crypto_profile;
--	if (__blk_crypto_cfg_supported(profile, &bc_key->crypto_cfg))
-+	if (blk_crypto_config_supported_natively(bio->bi_bdev,
-+						 &bc_key->crypto_cfg))
- 		return true;
--
- 	if (blk_crypto_fallback_bio_prep(bio_ptr))
- 		return true;
- fail:
-@@ -316,8 +323,9 @@ int __blk_crypto_rq_bio_prep(struct request *rq, struct bio *bio,
+@@ -314,8 +323,9 @@ int __blk_crypto_rq_bio_prep(struct request *rq, struct bio *bio,
  /**
   * blk_crypto_init_key() - Prepare a key for use with blk-crypto
   * @blk_key: Pointer to the blk_crypto_key to initialize.
@@ -578,7 +482,7 @@
   * @crypto_mode: identifier for the encryption algorithm to use
   * @dun_bytes: number of bytes that will be used to specify the DUN when this
   *	       key is used
-@@ -326,7 +334,9 @@ int __blk_crypto_rq_bio_prep(struct request *rq, struct bio *bio,
+@@ -324,7 +334,9 @@ int __blk_crypto_rq_bio_prep(struct request *rq, struct bio *bio,
   * Return: 0 on success, -errno on failure.  The caller is responsible for
   *	   zeroizing both blk_key and raw_key when done with them.
   */
@@ -589,7 +493,7 @@
  			enum blk_crypto_mode_num crypto_mode,
  			unsigned int dun_bytes,
  			unsigned int data_unit_size)
-@@ -339,8 +349,19 @@ int blk_crypto_init_key(struct blk_crypto_key *blk_key, const u8 *raw_key,
+@@ -337,8 +349,19 @@ int blk_crypto_init_key(struct blk_crypto_key *blk_key, const u8 *raw_key,
  		return -EINVAL;
  
  	mode = &blk_crypto_modes[crypto_mode];
@@ -610,7 +514,7 @@
  
  	if (dun_bytes == 0 || dun_bytes > mode->ivsize)
  		return -EINVAL;
-@@ -351,29 +372,39 @@ int blk_crypto_init_key(struct blk_crypto_key *blk_key, const u8 *raw_key,
+@@ -349,9 +372,10 @@ int blk_crypto_init_key(struct blk_crypto_key *blk_key, const u8 *raw_key,
  	blk_key->crypto_cfg.crypto_mode = crypto_mode;
  	blk_key->crypto_cfg.dun_bytes = dun_bytes;
  	blk_key->crypto_cfg.data_unit_size = data_unit_size;
@@ -623,26 +527,12 @@
  
  	return 0;
  }
- 
-+bool blk_crypto_config_supported_natively(struct block_device *bdev,
-+					  const struct blk_crypto_config *cfg)
-+{
-+	return __blk_crypto_cfg_supported(bdev_get_queue(bdev)->crypto_profile,
-+					  cfg);
-+}
-+
- /*
-  * Check if bios with @cfg can be en/decrypted by blk-crypto (i.e. either the
-- * request queue it's submitted to supports inline crypto, or the
-+ * block_device it's submitted to supports inline crypto, or the
-  * blk-crypto-fallback is enabled and supports the cfg).
-  */
--bool blk_crypto_config_supported(struct request_queue *q,
-+bool blk_crypto_config_supported(struct block_device *bdev,
+@@ -371,8 +395,10 @@ bool blk_crypto_config_supported_natively(struct block_device *bdev,
+ bool blk_crypto_config_supported(struct block_device *bdev,
  				 const struct blk_crypto_config *cfg)
  {
 -	return IS_ENABLED(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) ||
--	       __blk_crypto_cfg_supported(q->crypto_profile, cfg);
+-	       blk_crypto_config_supported_natively(bdev, cfg);
 +	if (IS_ENABLED(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) &&
 +	    cfg->key_type == BLK_CRYPTO_KEY_TYPE_STANDARD)
 +		return true;
@@ -650,24 +540,9 @@
  }
  
  /**
-  * blk_crypto_start_using_key() - Start using a blk_crypto_key on a device
-+ * @bdev: block device to operate on
-  * @key: A key to use on the device
-- * @q: the request queue for the device
-  *
-  * Upper layers must call this function to ensure that either the hardware
-  * supports the key's crypto settings, or the crypto API fallback has transforms
-@@ -385,18 +416,22 @@ bool blk_crypto_config_supported(struct request_queue *q,
-  *	   blk-crypto-fallback is either disabled or the needed algorithm
-  *	   is disabled in the crypto API; or another -errno code.
-  */
--int blk_crypto_start_using_key(const struct blk_crypto_key *key,
--			       struct request_queue *q)
-+int blk_crypto_start_using_key(struct block_device *bdev,
-+			       const struct blk_crypto_key *key)
+@@ -395,6 +421,10 @@ int blk_crypto_start_using_key(struct block_device *bdev,
  {
--	if (__blk_crypto_cfg_supported(q->crypto_profile, &key->crypto_cfg))
-+	if (blk_crypto_config_supported_natively(bdev, &key->crypto_cfg))
+ 	if (blk_crypto_config_supported_natively(bdev, &key->crypto_cfg))
  		return 0;
 +	if (key->crypto_cfg.key_type != BLK_CRYPTO_KEY_TYPE_STANDARD) {
 +		pr_warn_once("tried to use wrapped key, but hardware doesn't support it\n");
@@ -676,46 +551,9 @@
  	return blk_crypto_fallback_start_using_mode(key->crypto_cfg.crypto_mode);
  }
  
- /**
-  * blk_crypto_evict_key() - Evict a key from any inline encryption hardware
-  *			    it may have been programmed into
-- * @q: The request queue who's associated inline encryption hardware this key
-+ * @bdev: The block_device who's associated inline encryption hardware this key
-  *     might have been programmed into
-  * @key: The key to evict
-  *
-@@ -406,14 +441,16 @@ int blk_crypto_start_using_key(const struct blk_crypto_key *key,
-  *
-  * Return: 0 on success or if the key wasn't in any keyslot; -errno on error.
-  */
--int blk_crypto_evict_key(struct request_queue *q,
-+int blk_crypto_evict_key(struct block_device *bdev,
- 			 const struct blk_crypto_key *key)
- {
--	if (__blk_crypto_cfg_supported(q->crypto_profile, &key->crypto_cfg))
-+	struct request_queue *q = bdev_get_queue(bdev);
-+
-+	if (blk_crypto_config_supported_natively(bdev, &key->crypto_cfg))
- 		return __blk_crypto_evict_key(q->crypto_profile, key);
- 
- 	/*
--	 * If the request_queue didn't support the key, then blk-crypto-fallback
-+	 * If the block_device didn't support the key, then blk-crypto-fallback
- 	 * may have been used, so try to evict the key from blk-crypto-fallback.
- 	 */
- 	return blk_crypto_fallback_evict_key(key);
 diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
 --- a/drivers/md/dm-table.c
 +++ b/drivers/md/dm-table.c
-@@ -1215,7 +1215,7 @@ static int dm_keyslot_evict_callback(struct dm_target *ti, struct dm_dev *dev,
- 	struct dm_keyslot_evict_args *args = data;
- 	int err;
- 
--	err = blk_crypto_evict_key(bdev_get_queue(dev->bdev), args->key);
-+	err = blk_crypto_evict_key(dev->bdev, args->key);
- 	if (!args->err)
- 		args->err = err;
- 	/* Always try to evict the key from all devices. */
 @@ -1309,6 +1309,7 @@ static int dm_table_construct_crypto_profile(struct dm_table *t)
  	profile->max_dun_bytes_supported = UINT_MAX;
  	memset(profile->modes_supported, 0xFF,
@@ -750,28 +588,7 @@
 diff --git a/fs/crypto/inline_crypt.c b/fs/crypto/inline_crypt.c
 --- a/fs/crypto/inline_crypt.c
 +++ b/fs/crypto/inline_crypt.c
-@@ -12,7 +12,7 @@
-  * provides the key and IV to use.
-  */
- 
--#include <linux/blk-crypto-profile.h>
-+#include <linux/blk-crypto.h>
- #include <linux/blkdev.h>
- #include <linux/buffer_head.h>
- #include <linux/sched/mm.h>
-@@ -77,10 +77,8 @@ static void fscrypt_log_blk_crypto_impl(struct fscrypt_mode *mode,
- 	unsigned int i;
- 
- 	for (i = 0; i < num_devs; i++) {
--		struct request_queue *q = bdev_get_queue(devs[i]);
--
- 		if (!IS_ENABLED(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) ||
--		    __blk_crypto_cfg_supported(q->crypto_profile, cfg)) {
-+		    blk_crypto_config_supported_natively(devs[i], cfg)) {
- 			if (!xchg(&mode->logged_blk_crypto_native, 1))
- 				pr_info("fscrypt: %s using blk-crypto (native)\n",
- 					mode->friendly_name);
-@@ -133,14 +131,14 @@ int fscrypt_select_encryption_impl(struct fscrypt_info *ci)
+@@ -131,6 +131,7 @@ int fscrypt_select_encryption_impl(struct fscrypt_info *ci)
  	crypto_cfg.crypto_mode = ci->ci_mode->blk_crypto_mode;
  	crypto_cfg.data_unit_size = sb->s_blocksize;
  	crypto_cfg.dun_bytes = fscrypt_get_dun_bytes(ci);
@@ -779,16 +596,7 @@
  
  	devs = fscrypt_get_devices(sb, &num_devs);
  	if (IS_ERR(devs))
- 		return PTR_ERR(devs);
- 
- 	for (i = 0; i < num_devs; i++) {
--		if (!blk_crypto_config_supported(bdev_get_queue(devs[i]),
--						 &crypto_cfg))
-+		if (!blk_crypto_config_supported(devs[i], &crypto_cfg))
- 			goto out_free_devs;
- 	}
- 
-@@ -170,7 +168,7 @@ int fscrypt_prepare_inline_crypt_key(struct fscrypt_prepared_key *prep_key,
+@@ -167,7 +168,7 @@ int fscrypt_prepare_inline_crypt_key(struct fscrypt_prepared_key *prep_key,
  	if (!blk_key)
  		return -ENOMEM;
  
@@ -797,25 +605,6 @@
  				  fscrypt_get_dun_bytes(ci), sb->s_blocksize);
  	if (err) {
  		fscrypt_err(inode, "error %d initializing blk-crypto key", err);
-@@ -184,8 +182,7 @@ int fscrypt_prepare_inline_crypt_key(struct fscrypt_prepared_key *prep_key,
- 		goto fail;
- 	}
- 	for (i = 0; i < num_devs; i++) {
--		err = blk_crypto_start_using_key(blk_key,
--						 bdev_get_queue(devs[i]));
-+		err = blk_crypto_start_using_key(devs[i], blk_key);
- 		if (err)
- 			break;
- 	}
-@@ -224,7 +221,7 @@ void fscrypt_destroy_inline_crypt_key(struct super_block *sb,
- 	devs = fscrypt_get_devices(sb, &num_devs);
- 	if (!IS_ERR(devs)) {
- 		for (i = 0; i < num_devs; i++)
--			blk_crypto_evict_key(bdev_get_queue(devs[i]), blk_key);
-+			blk_crypto_evict_key(devs[i], blk_key);
- 		kfree(devs);
- 	}
- 	kfree_sensitive(blk_key);
 diff --git a/include/linux/blk-crypto-profile.h b/include/linux/blk-crypto-profile.h
 --- a/include/linux/blk-crypto-profile.h
 +++ b/include/linux/blk-crypto-profile.h
@@ -853,25 +642,6 @@
  	/**
  	 * @modes_supported: Array of bitmasks that specifies whether each
  	 * combination of crypto mode and data unit size is supported.
-@@ -138,18 +158,6 @@ int devm_blk_crypto_profile_init(struct device *dev,
- 
- unsigned int blk_crypto_keyslot_index(struct blk_crypto_keyslot *slot);
- 
--blk_status_t blk_crypto_get_keyslot(struct blk_crypto_profile *profile,
--				    const struct blk_crypto_key *key,
--				    struct blk_crypto_keyslot **slot_ptr);
--
--void blk_crypto_put_keyslot(struct blk_crypto_keyslot *slot);
--
--bool __blk_crypto_cfg_supported(struct blk_crypto_profile *profile,
--				const struct blk_crypto_config *cfg);
--
--int __blk_crypto_evict_key(struct blk_crypto_profile *profile,
--			   const struct blk_crypto_key *key);
--
- void blk_crypto_reprogram_all_keys(struct blk_crypto_profile *profile);
- 
- void blk_crypto_profile_destroy(struct blk_crypto_profile *profile);
 diff --git a/include/linux/blk-crypto.h b/include/linux/blk-crypto.h
 --- a/include/linux/blk-crypto.h
 +++ b/include/linux/blk-crypto.h
@@ -972,17 +742,7 @@
  };
  
  #define BLK_CRYPTO_MAX_IV_SIZE		32
-@@ -72,9 +126,6 @@ struct bio_crypt_ctx {
- #include <linux/blk_types.h>
- #include <linux/blkdev.h>
- 
--struct request;
--struct request_queue;
--
- #ifdef CONFIG_BLK_INLINE_ENCRYPTION
- 
- static inline bool bio_has_crypt_ctx(struct bio *bio)
-@@ -90,20 +141,31 @@ bool bio_crypt_dun_is_contiguous(const struct bio_crypt_ctx *bc,
+@@ -87,7 +141,9 @@ bool bio_crypt_dun_is_contiguous(const struct bio_crypt_ctx *bc,
  				 unsigned int bytes,
  				 const u64 next_dun[BLK_CRYPTO_DUN_ARRAY_SIZE]);
  
@@ -993,20 +753,8 @@
  			enum blk_crypto_mode_num crypto_mode,
  			unsigned int dun_bytes,
  			unsigned int data_unit_size);
- 
--int blk_crypto_start_using_key(const struct blk_crypto_key *key,
--			       struct request_queue *q);
-+int blk_crypto_start_using_key(struct block_device *bdev,
-+			       const struct blk_crypto_key *key);
- 
--int blk_crypto_evict_key(struct request_queue *q,
-+int blk_crypto_evict_key(struct block_device *bdev,
- 			 const struct blk_crypto_key *key);
- 
--bool blk_crypto_config_supported(struct request_queue *q,
-+bool blk_crypto_config_supported_natively(struct block_device *bdev,
-+					  const struct blk_crypto_config *cfg);
-+bool blk_crypto_config_supported(struct block_device *bdev,
+@@ -103,6 +159,13 @@ bool blk_crypto_config_supported_natively(struct block_device *bdev,
+ bool blk_crypto_config_supported(struct block_device *bdev,
  				 const struct blk_crypto_config *cfg);
  
 +int blk_crypto_derive_sw_secret(struct block_device *bdev,
diff --git a/android-mainline/ANDROID-dm-add-dm-default-key-target-for-metadata-encryption.patch b/android-mainline/ANDROID-dm-add-dm-default-key-target-for-metadata-encryption.patch
index 3627cd2..7af1e2b 100644
--- a/android-mainline/ANDROID-dm-add-dm-default-key-target-for-metadata-encryption.patch
+++ b/android-mainline/ANDROID-dm-add-dm-default-key-target-for-metadata-encryption.patch
@@ -61,7 +61,7 @@
 diff --git a/block/bio.c b/block/bio.c
 --- a/block/bio.c
 +++ b/block/bio.c
-@@ -264,6 +264,9 @@ void bio_init(struct bio *bio, struct block_device *bdev, struct bio_vec *table,
+@@ -270,6 +270,9 @@ void bio_init(struct bio *bio, struct block_device *bdev, struct bio_vec *table,
  #endif
  #ifdef CONFIG_BLK_INLINE_ENCRYPTION
  	bio->bi_crypt_context = NULL;
diff --git a/android-mainline/NOUPSTREAM-ANDROID-scsi-SCSI-related-vendor-hooks.patch b/android-mainline/NOUPSTREAM-ANDROID-scsi-SCSI-related-vendor-hooks.patch
index f5d57b0..279134d 100644
--- a/android-mainline/NOUPSTREAM-ANDROID-scsi-SCSI-related-vendor-hooks.patch
+++ b/android-mainline/NOUPSTREAM-ANDROID-scsi-SCSI-related-vendor-hooks.patch
@@ -186,7 +186,7 @@
  	if (queue_eh_work) {
  		/*
  		 * update the transfer error masks to sticky bits, let's do this
-@@ -9836,7 +9859,8 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
+@@ -9837,7 +9860,8 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
  	ufshcd_set_ufs_dev_active(hba);
  
  	async_schedule(ufshcd_async_scan, hba);
diff --git a/android-mainline/ONHOLD-ANDROID-scsi-ufs-allow-ufs-variants-to-override-sg-entry-size.patch b/android-mainline/ONHOLD-ANDROID-scsi-ufs-allow-ufs-variants-to-override-sg-entry-size.patch
index 4b24afe..def0463 100644
--- a/android-mainline/ONHOLD-ANDROID-scsi-ufs-allow-ufs-variants-to-override-sg-entry-size.patch
+++ b/android-mainline/ONHOLD-ANDROID-scsi-ufs-allow-ufs-variants-to-override-sg-entry-size.patch
@@ -132,7 +132,7 @@
  	cmd_desc_dma_addr = hba->ucdl_dma_addr;
  
  	for (i = 0; i < hba->nutrs; i++) {
-@@ -9611,6 +9612,7 @@ int ufshcd_alloc_host(struct device *dev, struct ufs_hba **hba_handle)
+@@ -9612,6 +9613,7 @@ int ufshcd_alloc_host(struct device *dev, struct ufs_hba **hba_handle)
  	hba->dev = dev;
  	hba->dev_ref_clk_freq = REF_CLK_FREQ_INVAL;
  	hba->nop_out_timeout = NOP_OUT_TIMEOUT;
diff --git a/android-mainline/Revert-scsi-ufs-core-Add-a-compile-time-structure-size-check.patch b/android-mainline/Revert-scsi-ufs-core-Add-a-compile-time-structure-size-check.patch
index 5c4af6f..2c2f7ea 100644
--- a/android-mainline/Revert-scsi-ufs-core-Add-a-compile-time-structure-size-check.patch
+++ b/android-mainline/Revert-scsi-ufs-core-Add-a-compile-time-structure-size-check.patch
@@ -21,7 +21,7 @@
 diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
 --- a/drivers/ufs/core/ufshcd.c
 +++ b/drivers/ufs/core/ufshcd.c
-@@ -9989,11 +9989,6 @@ static int __init ufshcd_core_init(void)
+@@ -9991,11 +9991,6 @@ static int __init ufshcd_core_init(void)
  {
  	int ret;
  
diff --git a/android-mainline/series b/android-mainline/series
index ed9b4b1..1771037 100644
--- a/android-mainline/series
+++ b/android-mainline/series
@@ -1,8 +1,8 @@
 #
 # android-mainline patches
 #
-# Applies onto upstream 96f7e448b9f45 Linux v6.1-3365-g96f7e448b9f45
-# Matches android-mainline ecd7f3d20306d ("Merge 96f7e448b9f4 ("Merge tag 'for-6.2/io_uring-next-2022-12-08' of git://git.kernel.dk/linux") into android-mainline")
+# Applies onto upstream ce8a79d5601aa Linux v6.1-3618-gce8a79d5601aa
+# Matches android-mainline 82c4e09b2e0a8 ("Merge ce8a79d5601a ("Merge tag 'for-6.2/block-2022-12-08' of git://git.kernel.dk/linux") into android-mainline")
 # Status: Tested
 #
 Revert-sched-core-Prevent-race-condition-between-cpuset-and-__sched_setscheduler.patch