Commit 531a071c authored by Colin Ian King's avatar Colin Ian King Committed by Kleber Sacilotto de Souza

pcrypt: use format specifier in kobject_add

BugLink: https://bugs.launchpad.net/bugs/1864773

[ Upstream commit b1e3874c ]

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: a3fb1e33 ("pcrypt: Added sysfs interface to pcrypt")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 26cf4d48
...@@ -394,7 +394,7 @@ static int pcrypt_sysfs_add(struct padata_instance *pinst, const char *name) ...@@ -394,7 +394,7 @@ static int pcrypt_sysfs_add(struct padata_instance *pinst, const char *name)
int ret; int ret;
pinst->kobj.kset = pcrypt_kset; pinst->kobj.kset = pcrypt_kset;
ret = kobject_add(&pinst->kobj, NULL, name); ret = kobject_add(&pinst->kobj, NULL, "%s", name);
if (!ret) if (!ret)
kobject_uevent(&pinst->kobj, KOBJ_ADD); kobject_uevent(&pinst->kobj, KOBJ_ADD);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment