mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] netfs: use kfree_sensitive() instend of kfree() in fscache_free_cookie()
@ 2024-01-08 11:27 Minjie Du
  2024-01-08 13:55 ` David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: Minjie Du @ 2024-01-08 11:27 UTC (permalink / raw)
  To: David Howells, moderated list:FILESYSTEMS [NETFS LIBRARY],
	open list:FILESYSTEMS [NETFS LIBRARY],
	open list
  Cc: opensource.kernel, Minjie Du

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

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 fs/netfs/fscache_cookie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/netfs/fscache_cookie.c b/fs/netfs/fscache_cookie.c
index bce2492186d0..5c917d87f281 100644
--- a/fs/netfs/fscache_cookie.c
+++ b/fs/netfs/fscache_cookie.c
@@ -74,7 +74,7 @@ static void fscache_free_cookie(struct fscache_cookie *cookie)
 	if (cookie->aux_len > sizeof(cookie->inline_aux))
 		kfree(cookie->aux);
 	if (cookie->key_len > sizeof(cookie->inline_key))
-		kfree(cookie->key);
+		kfree_sensitive(cookie->key);
 	fscache_stat_d(&fscache_n_cookies);
 	kmem_cache_free(fscache_cookie_jar, cookie);
 }
-- 
2.39.0


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

* Re: [PATCH v1] netfs: use kfree_sensitive() instend of kfree() in fscache_free_cookie()
  2024-01-08 11:27 [PATCH v1] netfs: use kfree_sensitive() instend of kfree() in fscache_free_cookie() Minjie Du
@ 2024-01-08 13:55 ` David Howells
  0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2024-01-08 13:55 UTC (permalink / raw)
  To: Minjie Du; +Cc: dhowells, linux-cachefs, linux-fsdevel, linux-kernel

Minjie Du <duminjie@vivo.com> wrote:

>  linux-cachefs@redhat.com (moderated
>  list:FILESYSTEMS [NETFS LIBRARY]), linux-fsdevel@vger.kernel.org (open
>  list:FILESYSTEMS [NETFS LIBRARY]), linux-kernel@vger.kernel.org (open list)

In future, could you edit the comments out of the email addresses, please?

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

There's no real point.  These are written as filenames (possibly base64-ish
encoded) on disk by cachefiles and represent the information given to the
server to indicate the file (in afs, for example, that's cell name, volume
name, vnode number).

David


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

end of thread, other threads:[~2024-01-08 13:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-08 11:27 [PATCH v1] netfs: use kfree_sensitive() instend of kfree() in fscache_free_cookie() Minjie Du
2024-01-08 13:55 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®