Re: [PATCH] pcrypt: use format specifier in kobject_add

From: Herbert Xu
Date: Fri Nov 09 2018 - 04:53:46 EST


On Sat, Oct 27, 2018 at 03:49:26PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> Passing string 'name' as the format specifier is potentially hazardous
> because name could (although very unlikely to) have a format specifier
> embedded in it causing issues when parsing the non-existent arguments
> to these. Follow best practice by using the "%s" format string for
> the string 'name'.
>
> Cleans up clang warning:
> crypto/pcrypt.c:397:40: warning: format string is not a string literal
> (potentially insecure) [-Wformat-security]
>
> Fixes: a3fb1e330dd2 ("pcrypt: Added sysfs interface to pcrypt")
> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
> ---
> crypto/pcrypt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt