drivers: avoid parsing names as kthread_run() format strings
Calling kthread_run with a single name parameter causes it to be handled as a format string. Many callers are passing potentially dynamic string content, so use "%s" in those cases to avoid any potential accidents. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
d8537548c9
commit
f170168b9a
@@ -1005,7 +1005,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
|
||||
if (err)
|
||||
goto out_uif;
|
||||
|
||||
ubi->bgt_thread = kthread_create(ubi_thread, ubi, ubi->bgt_name);
|
||||
ubi->bgt_thread = kthread_create(ubi_thread, ubi, "%s", ubi->bgt_name);
|
||||
if (IS_ERR(ubi->bgt_thread)) {
|
||||
err = PTR_ERR(ubi->bgt_thread);
|
||||
ubi_err("cannot spawn \"%s\", error %d", ubi->bgt_name,
|
||||
|
||||
Reference in New Issue
Block a user