# Re: \[PATCH v4 21/24\] powerpc/pseries: Pass PLPKS password on kexec

- From: Andrew Donnellan \<hidden\>
- Date: 2023-01-24 04:40:42 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2023/01/2077296
- Thread: https://ratatoskr.run/linuxppc-dev/2023/01/2073858/t.md

```text
On Tue, 2023-01-24 at 14:36 +1000, Nicholas Piggin wrote:
> 
> > +       prop = of_find_property(of_chosen, "ibm,plpks-pw", &len);
> > +       if (prop) {
> > +               ospasswordlength = (u16)len;
> > +               ospassword = kzalloc(ospasswordlength, GFP_KERNEL);
> > +               if (!ospassword) {
> > +                       of_remove_property(of_chosen, prop);
> > +                       return -ENOMEM;
> > +               }
> > +               memcpy(ospassword, prop->value, len);
> > +               return of_remove_property(of_chosen, prop);
> 
> Why do you remove the property afterward?

Because otherwise the password will be sitting around in /proc/device-
tree for the world to go and read.

-- 
Andrew Donnellan    OzLabs, ADL Canberra
ajd@linux.ibm.com   IBM Australia Limited
```
