diff options
author | Kees Cook <keescook@chromium.org> | 2013-07-03 18:04:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:07:41 -0400 |
commit | f170168b9a0b61ea1e647b082b38f605f1d3de3e (patch) | |
tree | 4381c129ee9af108e368e6c8255df53cbe233257 /drivers/block | |
parent | d8537548c924db3c44afde7646b6e220c7beb79d (diff) |
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>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 2 | ||||
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 3 | ||||
-rw-r--r-- | drivers/block/xen-blkback/xenbus.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index fc803ecbbce4..b75c7db16559 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -1340,7 +1340,7 @@ aoe_ktstart(struct ktstate *k) | |||
1340 | struct task_struct *task; | 1340 | struct task_struct *task; |
1341 | 1341 | ||
1342 | init_completion(&k->rendez); | 1342 | init_completion(&k->rendez); |
1343 | task = kthread_run(kthread, k, k->name); | 1343 | task = kthread_run(kthread, k, "%s", k->name); |
1344 | if (task == NULL || IS_ERR(task)) | 1344 | if (task == NULL || IS_ERR(task)) |
1345 | return -ENOMEM; | 1345 | return -ENOMEM; |
1346 | k->task = task; | 1346 | k->task = task; |
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 20dd52a2f92f..952dbfe22126 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
@@ -4087,7 +4087,8 @@ skip_create_disk: | |||
4087 | start_service_thread: | 4087 | start_service_thread: |
4088 | sprintf(thd_name, "mtip_svc_thd_%02d", index); | 4088 | sprintf(thd_name, "mtip_svc_thd_%02d", index); |
4089 | dd->mtip_svc_handler = kthread_create_on_node(mtip_service_thread, | 4089 | dd->mtip_svc_handler = kthread_create_on_node(mtip_service_thread, |
4090 | dd, dd->numa_node, thd_name); | 4090 | dd, dd->numa_node, "%s", |
4091 | thd_name); | ||
4091 | 4092 | ||
4092 | if (IS_ERR(dd->mtip_svc_handler)) { | 4093 | if (IS_ERR(dd->mtip_svc_handler)) { |
4093 | dev_err(&dd->pdev->dev, "service thread failed to start\n"); | 4094 | dev_err(&dd->pdev->dev, "service thread failed to start\n"); |
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index 8bfd1bcf95ec..04608a6502d7 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c | |||
@@ -93,7 +93,7 @@ static void xen_update_blkif_status(struct xen_blkif *blkif) | |||
93 | } | 93 | } |
94 | invalidate_inode_pages2(blkif->vbd.bdev->bd_inode->i_mapping); | 94 | invalidate_inode_pages2(blkif->vbd.bdev->bd_inode->i_mapping); |
95 | 95 | ||
96 | blkif->xenblkd = kthread_run(xen_blkif_schedule, blkif, name); | 96 | blkif->xenblkd = kthread_run(xen_blkif_schedule, blkif, "%s", name); |
97 | if (IS_ERR(blkif->xenblkd)) { | 97 | if (IS_ERR(blkif->xenblkd)) { |
98 | err = PTR_ERR(blkif->xenblkd); | 98 | err = PTR_ERR(blkif->xenblkd); |
99 | blkif->xenblkd = NULL; | 99 | blkif->xenblkd = NULL; |