mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
d8537548c9
commit
f170168b9a
19 changed files with 28 additions and 22 deletions
|
|
@ -1340,7 +1340,7 @@ aoe_ktstart(struct ktstate *k)
|
|||
struct task_struct *task;
|
||||
|
||||
init_completion(&k->rendez);
|
||||
task = kthread_run(kthread, k, k->name);
|
||||
task = kthread_run(kthread, k, "%s", k->name);
|
||||
if (task == NULL || IS_ERR(task))
|
||||
return -ENOMEM;
|
||||
k->task = task;
|
||||
|
|
|
|||
|
|
@ -4087,7 +4087,8 @@ skip_create_disk:
|
|||
start_service_thread:
|
||||
sprintf(thd_name, "mtip_svc_thd_%02d", index);
|
||||
dd->mtip_svc_handler = kthread_create_on_node(mtip_service_thread,
|
||||
dd, dd->numa_node, thd_name);
|
||||
dd, dd->numa_node, "%s",
|
||||
thd_name);
|
||||
|
||||
if (IS_ERR(dd->mtip_svc_handler)) {
|
||||
dev_err(&dd->pdev->dev, "service thread failed to start\n");
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ static void xen_update_blkif_status(struct xen_blkif *blkif)
|
|||
}
|
||||
invalidate_inode_pages2(blkif->vbd.bdev->bd_inode->i_mapping);
|
||||
|
||||
blkif->xenblkd = kthread_run(xen_blkif_schedule, blkif, name);
|
||||
blkif->xenblkd = kthread_run(xen_blkif_schedule, blkif, "%s", name);
|
||||
if (IS_ERR(blkif->xenblkd)) {
|
||||
err = PTR_ERR(blkif->xenblkd);
|
||||
blkif->xenblkd = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue