]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
pcrypt: use format specifier in kobject_add
authorColin Ian King <colin.king@canonical.com>
Sat, 27 Oct 2018 14:49:26 +0000 (15:49 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commita7be4e99e88fc855892badcb83390fd06378ab32
tree4983829f3dfb12b56f4aada6daecbfb93dc4b1a8
parent7379c4a3ee1ee12f37038414b403ff9a4c992ca4
pcrypt: use format specifier in kobject_add

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit b1e3874c75ab15288f573b3532e507c37e8e7656 ]

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@canonical.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
crypto/pcrypt.c