netfs: use kfree_sensitive() instend of kfree() in fscache_free_cookie()
Subsystems (2)
PATCH 1/1 netfs: use kfree_sensitive() instend of kfree() in fscache_free_cookie()
key might contain private information, so use kfree_sensitive to free it. In fscache_free_cookie() use kfree_sensitive().
--- fs/netfs/fscache_cookie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/netfs/fscache_cookie.c +1 -1
@@ -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); }
Signature · 1 line
2.39.0
David Howells
maintainerQuoted 3 lines · Minjie Du
[email protected] (moderated
list:FILESYSTEMS [NETFS LIBRARY]), [email protected] (open list:FILESYSTEMS [NETFS LIBRARY]), [email protected] (open list)
In future, could you edit the comments out of the email addresses, please?
Quoted 2 lines
key might contain private information, so use
kfree_sensitiveto free it. Infscache_free_cookie()usekfree_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