Skip to content

Commit f36e664

Browse files
committed
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>
1 parent 573de2a commit f36e664

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

kernel/livepatch/transition.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,11 @@ static int klp_check_stack(struct task_struct *task, char *err_buf)
293293
*/
294294
static bool klp_try_switch_task(struct task_struct *task)
295295
{
296+
static char err_buf[STACK_ERR_BUF_SIZE];
296297
struct rq *rq;
297298
struct rq_flags flags;
298299
int ret;
299300
bool success = false;
300-
char err_buf[STACK_ERR_BUF_SIZE];
301301

302302
err_buf[0] = '\0';
303303

@@ -340,7 +340,6 @@ static bool klp_try_switch_task(struct task_struct *task)
340340
pr_debug("%s", err_buf);
341341

342342
return success;
343-
344343
}
345344

346345
/*

0 commit comments

Comments
 (0)