summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2018-10-27 15:49:26 +0100
committerBen Hutchings <ben@decadent.org.uk>2019-04-04 16:13:40 +0100
commit8c9874721f886bb11464ba1d132a9cc0efe8536e (patch)
treebe7ea826548a672e2cbe3373171882267be73036 /crypto
parent8bd55c2283ca142fd9aa7682ce1acd1edc66ca9b (diff)
downloadlinux-stable-8c9874721f886bb11464ba1d132a9cc0efe8536e.tar.gz
linux-stable-8c9874721f886bb11464ba1d132a9cc0efe8536e.tar.bz2
linux-stable-8c9874721f886bb11464ba1d132a9cc0efe8536e.zip
pcrypt: use format specifier in kobject_add
commit b1e3874c75ab15288f573b3532e507c37e8e7656 upstream. 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: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/pcrypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index c305d4112735..a96de79498ee 100644
--- a/crypto/pcrypt.c
+++ b/crypto/pcrypt.c
@@ -440,7 +440,7 @@ static int pcrypt_sysfs_add(struct padata_instance *pinst, const char *name)
int ret;
pinst->kobj.kset = pcrypt_kset;
- ret = kobject_add(&pinst->kobj, NULL, name);
+ ret = kobject_add(&pinst->kobj, NULL, "%s", name);
if (!ret)
kobject_uevent(&pinst->kobj, KOBJ_ADD);