mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-20 08:47:59 -05:00
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
This commit is contained in:
committed by
Michael Ellerman
parent
74726fda9f
commit
ca2b746d5f
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user