Skip to contentSkip to conversation

staging: unisys: drop format string in kthread_run

PATCH In review Kees Cook 2 participants 2 messages Jun 4, 2015 – Jun 5, 2015 Staging

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 staging: unisys: drop format string in kthread_run

Calling kthread_run with a single name parameter causes it to be handled as a format string. Since the uisthread interface lacks format parameters, use "%s" to avoid any potential accidents from callers passing in dynamic string content.

---
 drivers/staging/unisys/uislib/uisthread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/unisys/uislib/uisthread.c +1 -1
index d3c973b617ee..4c53eaff3c37 100644
@@ -40,7 +40,7 @@ uisthread_start(struct uisthread_info *thrinfo,
 {
 	/* used to stop the thread */
 	init_completion(&thrinfo->has_stopped);
-	thrinfo->task = kthread_run(threadfn, thrcontext, name);
+	thrinfo->task = kthread_run(threadfn, thrcontext, "%s", name);
 	if (IS_ERR(thrinfo->task)) {
 		thrinfo->id = 0;
 		return 0;	/* failure */
Signature · 6 lines
1.9.1


-- 
Kees Cook
Chrome OS Security
#1 lore raw
Quoted 4 lines · Kees Cook

Calling kthread_run with a single name parameter causes it to be handled as a format string. Since the uisthread interface lacks format parameters, use "%s" to avoid any potential accidents from callers passing in dynamic string content.

uislib folder has already been deleted in staging-testing tree.

regards
sudip