public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: unisys: drop format string in kthread_run
@ 2015-06-04 18:37 Kees Cook
  2015-06-05  6:35 ` Sudip Mukherjee
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2015-06-04 18:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: Benjamin Romer, David Kershner, Greg Kroah-Hartman, Devendra Naga,
	Bryan Thompson, Michel von Czettritz, sparmaintainer, devel

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.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/staging/unisys/uislib/uisthread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/uislib/uisthread.c b/drivers/staging/unisys/uislib/uisthread.c
index d3c973b617ee..4c53eaff3c37 100644
--- a/drivers/staging/unisys/uislib/uisthread.c
+++ b/drivers/staging/unisys/uislib/uisthread.c
@@ -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 */
-- 
1.9.1


-- 
Kees Cook
Chrome OS Security

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-05  6:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-04 18:37 [PATCH] staging: unisys: drop format string in kthread_run Kees Cook
2015-06-05  6:35 ` Sudip Mukherjee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox