diff options
author | Petr Mladek <pmladek@suse.com> | 2019-05-31 03:41:47 -0400 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2019-06-05 10:35:47 -0400 |
commit | f36e664516b02c7f54bbd3094bab047d54bb5488 (patch) | |
tree | 1b38ba781e732d39f39515b711aa37de47fe58bb | |
parent | 573de2a6e844cb230c4483833f29b8344a6a17cc (diff) |
livepatch: Use static buffer for debugging messages under rq lock
The err_buf array uses 128 bytes of stack space. Move it off the stack
by making it static. It's safe to use a shared buffer because
klp_try_switch_task() is called under klp_mutex.
Acked-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
-rw-r--r-- | kernel/livepatch/transition.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index c53370d596be..0a3889c4f617 100644 --- a/kernel/livepatch/transition.c +++ b/kernel/livepatch/transition.c | |||
@@ -293,11 +293,11 @@ static int klp_check_stack(struct task_struct *task, char *err_buf) | |||
293 | */ | 293 | */ |
294 | static bool klp_try_switch_task(struct task_struct *task) | 294 | static bool klp_try_switch_task(struct task_struct *task) |
295 | { | 295 | { |
296 | static char err_buf[STACK_ERR_BUF_SIZE]; | ||
296 | struct rq *rq; | 297 | struct rq *rq; |
297 | struct rq_flags flags; | 298 | struct rq_flags flags; |
298 | int ret; | 299 | int ret; |
299 | bool success = false; | 300 | bool success = false; |
300 | char err_buf[STACK_ERR_BUF_SIZE]; | ||
301 | 301 | ||
302 | err_buf[0] = '\0'; | 302 | err_buf[0] = '\0'; |
303 | 303 | ||
@@ -340,7 +340,6 @@ done: | |||
340 | pr_debug("%s", err_buf); | 340 | pr_debug("%s", err_buf); |
341 | 341 | ||
342 | return success; | 342 | return success; |
343 | |||
344 | } | 343 | } |
345 | 344 | ||
346 | /* | 345 | /* |