[Skiboot] [PATCH] nvram: Fix a possible NULL pointer de-ref in nvram_query_eq()

Stewart Smith stewart at linux.ibm.com
Tue Sep 18 17:42:01 AEST 2018


Vaibhav Jain <vaibhav at linux.ibm.com> writes:
> A fault will occur if 'value == NULL' is passed to nvram_query_eq() to
> check if a given key doesn't exists in nvram partition. This is an
> invalid use of the API as its only supposed to be used for keys that
> exist in nvram and 'value == NULL' is never possible.
>
> Hence this patch adds an assert to the function to flag such a use and
> also prevent NULL being passed as an argument to strcmp().
>
> Signed-off-by: Vaibhav Jain <vaibhav at linux.ibm.com>
> Suggested-by: Oliver O'Halloran <oohall at gmail.com>
> ---
> Change-log:
>
> v2	-> Instead of handling 'value == NULL' trigger an assert as
> 	its an invalid use of the api. [Oliver]

Thanks. Merged to master as of a6fca4819fd1cae4e9afc374ba2ed34495865f65

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list