aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-07-03 18:04:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:41 -0400
commitf170168b9a0b61ea1e647b082b38f605f1d3de3e (patch)
tree4381c129ee9af108e368e6c8255df53cbe233257 /fs/nfs/callback.c
parentd8537548c924db3c44afde7646b6e220c7beb79d (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 'fs/nfs/callback.c')
-rw-r--r--fs/nfs/callback.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index cff089a412c7..da6a43d19aa3 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -211,7 +211,6 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt,
211 struct svc_rqst *rqstp; 211 struct svc_rqst *rqstp;
212 int (*callback_svc)(void *vrqstp); 212 int (*callback_svc)(void *vrqstp);
213 struct nfs_callback_data *cb_info = &nfs_callback_info[minorversion]; 213 struct nfs_callback_data *cb_info = &nfs_callback_info[minorversion];
214 char svc_name[12];
215 int ret; 214 int ret;
216 215
217 nfs_callback_bc_serv(minorversion, xprt, serv); 216 nfs_callback_bc_serv(minorversion, xprt, serv);
@@ -235,10 +234,10 @@ static int nfs_callback_start_svc(int minorversion, struct rpc_xprt *xprt,
235 234
236 svc_sock_update_bufs(serv); 235 svc_sock_update_bufs(serv);
237 236
238 sprintf(svc_name, "nfsv4.%u-svc", minorversion);
239 cb_info->serv = serv; 237 cb_info->serv = serv;
240 cb_info->rqst = rqstp; 238 cb_info->rqst = rqstp;
241 cb_info->task = kthread_run(callback_svc, cb_info->rqst, svc_name); 239 cb_info->task = kthread_run(callback_svc, cb_info->rqst,
240 "nfsv4.%u-svc", minorversion);
242 if (IS_ERR(cb_info->task)) { 241 if (IS_ERR(cb_info->task)) {
243 ret = PTR_ERR(cb_info->task); 242 ret = PTR_ERR(cb_info->task);
244 svc_exit_thread(cb_info->rqst); 243 svc_exit_thread(cb_info->rqst);