Eric Biggers
47a846536e
block/keyslot-manager: prevent crash when num_slots=1
...
If there is only one keyslot, then blk_ksm_init() computes
slot_hashtable_size=1 and log_slot_ht_size=0. This causes
blk_ksm_find_keyslot() to crash later because it uses
hash_ptr(key, log_slot_ht_size) to find the hash bucket containing the
key, and hash_ptr() doesn't support the bits == 0 case.
Fix this by making the hash table always have at least 2 buckets.
Tested by running:
kvm-xfstests -c ext4 -g encrypt -m inlinecrypt \
-o blk-crypto-fallback.num_keyslots=1
Fixes: 1b2628397058 ("block: Keyslot Manager for Inline Encryption")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-11-20 11:52:52 -07:00
..
2020-10-13 12:12:44 -07:00
2020-08-23 17:36:59 -05:00
2020-08-18 07:48:08 -07:00
2020-10-13 12:12:44 -07:00
2020-08-18 07:48:08 -07:00
2020-08-18 07:48:08 -07:00
2020-07-02 12:38:18 -06:00
2020-10-28 07:51:02 -06:00
2019-11-07 12:28:13 -07:00
2019-11-07 12:28:13 -07:00
2020-11-14 11:17:34 -07:00
2020-10-13 15:05:05 -06:00
2020-07-01 07:27:24 -06:00
2020-10-05 10:47:43 -06:00
2020-10-05 10:47:43 -06:00
2020-05-27 05:21:23 -06:00
2020-11-13 14:24:16 -07:00
2020-10-06 07:29:53 -06:00
2020-07-16 10:22:15 -06:00
2020-10-09 12:34:06 -06:00
2020-10-08 07:59:48 -06:00
2020-09-25 08:18:57 -06:00
2020-09-23 09:18:39 -06:00
2020-10-06 07:29:53 -06:00
2020-10-20 07:08:17 -06:00
2019-01-17 21:21:40 -07:00
2020-09-24 13:43:39 -06:00
2019-06-13 03:00:30 -06:00
2019-05-31 15:12:34 -06:00
2019-05-31 15:12:34 -06:00
2020-10-09 12:35:39 -06:00
2020-10-13 12:12:44 -07:00
2020-10-09 12:46:28 -06:00
2020-09-29 08:11:00 -06:00
2020-09-03 15:20:47 -06:00
2020-03-17 20:55:21 +01:00
2020-10-24 12:46:42 -07:00
2020-09-03 15:20:47 -06:00
2020-07-24 22:09:55 -04:00
2020-07-15 09:33:37 -06:00
2019-10-15 10:13:13 -06:00
2020-10-13 12:12:44 -07:00
2020-09-01 16:48:46 -06:00
2020-10-09 12:46:28 -06:00
2020-10-08 08:01:38 -06:00
2020-07-31 16:29:47 -06:00
2020-08-23 17:36:59 -05:00
2020-05-29 16:30:39 -06:00
2020-08-03 09:24:04 -06:00
2020-10-06 07:29:53 -06:00
2020-10-05 10:47:43 -06:00
2020-09-23 09:18:13 -06:00
2020-01-03 09:33:21 +01:00
2020-10-09 12:34:06 -06:00
2020-11-12 13:59:04 -07:00
2020-09-25 08:18:57 -06:00
2020-09-01 19:38:33 -06:00
2020-09-01 16:49:26 -06:00
2020-06-14 01:57:21 +09:00
2020-11-20 11:52:52 -07:00
2020-09-03 15:20:47 -06:00
2020-06-24 09:15:56 -06:00
2020-09-03 15:20:47 -06:00
2020-03-12 08:00:10 -06:00
2020-10-13 13:04:41 -07:00
2020-03-12 08:00:10 -06:00
2020-01-06 20:59:04 -07:00