summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries
diff options
context:
space:
mode:
authorMinjie Du <duminjie@vivo.com>2023-07-17 17:26:48 +0800
committerMichael Ellerman <mpe@ellerman.id.au>2023-10-20 23:22:17 +1100
commitca2b746d5f91a37f01baedff54b9315a50ee617d (patch)
treeb1453627707cde7a383b99f319296a9841acf9e0 /arch/powerpc/platforms/pseries
parent74726fda9fe306f848088ef73ec266cae0470d5b (diff)
downloadlinux-ca2b746d5f91a37f01baedff54b9315a50ee617d.tar.gz
linux-ca2b746d5f91a37f01baedff54b9315a50ee617d.tar.bz2
linux-ca2b746d5f91a37f01baedff54b9315a50ee617d.zip
powerpc/pseries: use kfree_sensitive() in plpks_gen_password()
password might contain private information, so better use kfree_sensitive to free it. In plpks_gen_password() use kfree_sensitive(). Signed-off-by: Minjie Du <duminjie@vivo.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230717092648.9752-1-duminjie@vivo.com
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-rw-r--r--arch/powerpc/platforms/pseries/plpks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/plpks.c b/arch/powerpc/platforms/pseries/plpks.c
index 2d40304eb6c1..febe18f251d0 100644
--- a/arch/powerpc/platforms/pseries/plpks.c
+++ b/arch/powerpc/platforms/pseries/plpks.c
@@ -150,7 +150,7 @@ static int plpks_gen_password(void)
ospasswordlength = maxpwsize;
ospassword = kzalloc(maxpwsize, GFP_KERNEL);
if (!ospassword) {
- kfree(password);
+ kfree_sensitive(password);
return -ENOMEM;
}
memcpy(ospassword, password, ospasswordlength);
@@ -163,7 +163,7 @@ static int plpks_gen_password(void)
}
}
out:
- kfree(password);
+ kfree_sensitive(password);
return pseries_status_to_err(rc);
}