linux-block.vger.kernel.org archive mirror
 help / color / mirror / 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 related	[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, other threads:[~2020-06-29 19:24 UTC | newest]

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).