From: Eric Biggers <ebiggers@kernel.org>
To: linux-block@vger.kernel.org
Cc: Satya Tangirala <satyat@google.com>
Subject: [PATCH] block/keyslot-manager: use kvfree_sensitive()
Date: Tue, 16 Jun 2020 08:56:54 -0700 [thread overview]
Message-ID: <20200616155654.191263-1-ebiggers@kernel.org> (raw)
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
next reply other threads:[~2020-06-16 15:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 15:56 Eric Biggers [this message]
2020-06-29 16:51 ` [PATCH] block/keyslot-manager: use kvfree_sensitive() Eric Biggers
2020-06-29 19:24 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200616155654.191263-1-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=satyat@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).