Skip to contentSkip to conversation

netfs: use kfree_sensitive() instend of kfree() in fscache_free_volume()

PATCH In review Minjie Du 2 participants 2 messages Jan 8, 2024

Subsystems (2)
lore
Share & tools
lore

Minjie Du

author
#0 lore raw

PATCH 1/1 netfs: use kfree_sensitive() instend of kfree() in fscache_free_volume()

key might contain private information, so use kfree_sensitive to free it. In fscache_free_volume() use kfree_sensitive().

---
 fs/netfs/fscache_volume.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/netfs/fscache_volume.c +1 -1
index cdf991bdd9de..648a7d6eaa6a 100644
@@ -397,7 +397,7 @@ static void fscache_free_volume(struct fscache_volume *volume)
 		fscache_unhash_volume(volume);
 
 	trace_fscache_volume(volume->debug_id, 0, fscache_volume_free);
-	kfree(volume->key);
+	kfree_sensitive(volume->key);
 	kfree(volume);
 	fscache_stat_d(&fscache_n_volumes);
 	fscache_put_cache(cache, fscache_cache_put_volume);
Signature · 1 line
2.39.0
maintainer
#1 lore raw

You sent this twice - I replied to the other post. But this is an unnecessary use of kfree_sensitive() as the key is made public.

David