Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] block/keyslot-manager: use kvfree_sensitive()
@ 2020-06-16 15:56 Eric Biggers
  2020-06-29 16:51 ` Eric Biggers
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Biggers @ 2020-06-16 15:56 UTC (permalink / raw)
  To: linux-block; +Cc: Satya Tangirala

From: Eric Biggers <ebiggers@google.com>

Make blk_ksm_destroy() use the kvfree_sensitive() function (which was
introduced in v5.8-rc1) instead of open-coding it.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 block/keyslot-manager.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/keyslot-manager.c b/block/keyslot-manager.c
index c2ef41b3147b..35abcb1ec051 100644
--- a/block/keyslot-manager.c
+++ b/block/keyslot-manager.c
@@ -374,8 +374,7 @@ void blk_ksm_destroy(struct blk_keyslot_manager *ksm)
 	if (!ksm)
 		return;
 	kvfree(ksm->slot_hashtable);
-	memzero_explicit(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
-	kvfree(ksm->slots);
+	kvfree_sensitive(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
 	memzero_explicit(ksm, sizeof(*ksm));
 }
 EXPORT_SYMBOL_GPL(blk_ksm_destroy);
-- 
2.27.0.290.gba653c62da-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block/keyslot-manager: use kvfree_sensitive()
  2020-06-16 15:56 [PATCH] block/keyslot-manager: use kvfree_sensitive() Eric Biggers
@ 2020-06-29 16:51 ` Eric Biggers
  2020-06-29 19:24   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Biggers @ 2020-06-29 16:51 UTC (permalink / raw)
  To: linux-block; +Cc: Satya Tangirala

On Tue, Jun 16, 2020 at 08:56:54AM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> Make blk_ksm_destroy() use the kvfree_sensitive() function (which was
> introduced in v5.8-rc1) instead of open-coding it.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
>  block/keyslot-manager.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/block/keyslot-manager.c b/block/keyslot-manager.c
> index c2ef41b3147b..35abcb1ec051 100644
> --- a/block/keyslot-manager.c
> +++ b/block/keyslot-manager.c
> @@ -374,8 +374,7 @@ void blk_ksm_destroy(struct blk_keyslot_manager *ksm)
>  	if (!ksm)
>  		return;
>  	kvfree(ksm->slot_hashtable);
> -	memzero_explicit(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
> -	kvfree(ksm->slots);
> +	kvfree_sensitive(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
>  	memzero_explicit(ksm, sizeof(*ksm));
>  }
>  EXPORT_SYMBOL_GPL(blk_ksm_destroy);
> -- 

Ping?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block/keyslot-manager: use kvfree_sensitive()
  2020-06-29 16:51 ` Eric Biggers
@ 2020-06-29 19:24   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2020-06-29 19:24 UTC (permalink / raw)
  To: Eric Biggers, linux-block; +Cc: Satya Tangirala

On 6/29/20 10:51 AM, Eric Biggers wrote:
> On Tue, Jun 16, 2020 at 08:56:54AM -0700, Eric Biggers wrote:
>> From: Eric Biggers <ebiggers@google.com>
>>
>> Make blk_ksm_destroy() use the kvfree_sensitive() function (which was
>> introduced in v5.8-rc1) instead of open-coding it.
>>
>> Signed-off-by: Eric Biggers <ebiggers@google.com>
>> ---
>>  block/keyslot-manager.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/block/keyslot-manager.c b/block/keyslot-manager.c
>> index c2ef41b3147b..35abcb1ec051 100644
>> --- a/block/keyslot-manager.c
>> +++ b/block/keyslot-manager.c
>> @@ -374,8 +374,7 @@ void blk_ksm_destroy(struct blk_keyslot_manager *ksm)
>>  	if (!ksm)
>>  		return;
>>  	kvfree(ksm->slot_hashtable);
>> -	memzero_explicit(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
>> -	kvfree(ksm->slots);
>> +	kvfree_sensitive(ksm->slots, sizeof(ksm->slots[0]) * ksm->num_slots);
>>  	memzero_explicit(ksm, sizeof(*ksm));
>>  }
>>  EXPORT_SYMBOL_GPL(blk_ksm_destroy);
>> -- 
> 
> Ping?

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 15:56 [PATCH] block/keyslot-manager: use kvfree_sensitive() Eric Biggers
2020-06-29 16:51 ` Eric Biggers
2020-06-29 19:24   ` Jens Axboe

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git