Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9edf0f67 authored by Kees Cook's avatar Kees Cook Committed by Greg Kroah-Hartman
Browse files

staging: lustre: clean up format string usages



This fixes up the usage of snprintf, strncpy, and format strings in the
call to kthread_run to avoid ever accidentally allowing a format string
into the thread name.

Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1ea12fef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1802,7 +1802,7 @@ kiblnd_recv (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed,
int
kiblnd_thread_start(int (*fn)(void *arg), void *arg, char *name)
{
	struct task_struct *task = kthread_run(fn, arg, name);
	struct task_struct *task = kthread_run(fn, arg, "%s", name);

	if (IS_ERR(task))
		return PTR_ERR(task);
+1 −1
Original line number Diff line number Diff line
@@ -1005,7 +1005,7 @@ ksocknal_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg)
int
ksocknal_thread_start(int (*fn)(void *arg), void *arg, char *name)
{
	struct task_struct *task = kthread_run(fn, arg, name);
	struct task_struct *task = kthread_run(fn, arg, "%s", name);

	if (IS_ERR(task))
		return PTR_ERR(task);
+2 −2
Original line number Diff line number Diff line
@@ -800,9 +800,9 @@ static int ldlm_bl_thread_start(struct ldlm_bl_pool *blp)

	init_completion(&bltd.bltd_comp);
	bltd.bltd_num = atomic_read(&blp->blp_num_threads);
	snprintf(bltd.bltd_name, sizeof(bltd.bltd_name) - 1,
	snprintf(bltd.bltd_name, sizeof(bltd.bltd_name),
		"ldlm_bl_%02d", bltd.bltd_num);
	task = kthread_run(ldlm_bl_thread_main, &bltd, bltd.bltd_name);
	task = kthread_run(ldlm_bl_thread_main, &bltd, "%s", bltd.bltd_name);
	if (IS_ERR(task)) {
		CERROR("cannot start LDLM thread ldlm_bl_%02d: rc %ld\n",
		       atomic_read(&blp->blp_num_threads), PTR_ERR(task));
+1 −1
Original line number Diff line number Diff line
@@ -397,7 +397,7 @@ cfs_wi_sched_create(char *name, struct cfs_cpt_table *cptab,
				 sched->ws_name, sched->ws_nthreads);
		}

		task = kthread_run(cfs_wi_scheduler, sched, name);
		task = kthread_run(cfs_wi_scheduler, sched, "%s", name);
		if (!IS_ERR(task)) {
			nthrs--;
			continue;
+2 −2
Original line number Diff line number Diff line
@@ -383,8 +383,8 @@ int ptlrpc_start_pinger(void)

	/* CLONE_VM and CLONE_FILES just avoid a needless copy, because we
	 * just drop the VM and FILES in cfs_daemonize_ctxt() right away. */
	rc = PTR_ERR(kthread_run(ptlrpc_pinger_main,
				 &pinger_thread, pinger_thread.t_name));
	rc = PTR_ERR(kthread_run(ptlrpc_pinger_main, &pinger_thread,
				 "%s", pinger_thread.t_name));
	if (IS_ERR_VALUE(rc)) {
		CERROR("cannot start thread: %d\n", rc);
		return rc;
Loading