summaryrefslogtreecommitdiffstats
path: root/kernel/livepatch/transition.c
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.com>2019-05-31 09:41:47 +0200
committerPetr Mladek <pmladek@suse.com>2019-06-05 16:35:47 +0200
commitf36e664516b02c7f54bbd3094bab047d54bb5488 (patch)
tree1b38ba781e732d39f39515b711aa37de47fe58bb /kernel/livepatch/transition.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/liv... (diff)
downloadlinux-f36e664516b02c7f54bbd3094bab047d54bb5488.tar.xz
linux-f36e664516b02c7f54bbd3094bab047d54bb5488.zip
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>
Diffstat (limited to 'kernel/livepatch/transition.c')
-rw-r--r--kernel/livepatch/transition.c3
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)
*/
static bool klp_try_switch_task(struct task_struct *task)
{
+ static char err_buf[STACK_ERR_BUF_SIZE];
struct rq *rq;
struct rq_flags flags;
int ret;
bool success = false;
- char err_buf[STACK_ERR_BUF_SIZE];
err_buf[0] = '\0';
@@ -340,7 +340,6 @@ done:
pr_debug("%s", err_buf);
return success;
-
}
/*