From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Cc: stable@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>,
Borislav Petkov <bp@suse.de>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: v5.15.57 regression - boot panic after retbleed backports with CONFIG_KPROBES_SANITY_TEST=y
Date: Fri, 5 Aug 2022 20:11:00 -0400 [thread overview]
Message-ID: <20220806001100.GD42579@windriver.com> (raw)
In-Reply-To: <Yu2H/Rdg/U4bHWaY@quatroqueijos>
[Re: v5.15.57 regression - boot panic after retbleed backports with CONFIG_KPROBES_SANITY_TEST=y] On 05/08/2022 (Fri 18:13) Thadeu Lima de Souza Cascardo wrote:
> On Fri, Aug 05, 2022 at 04:04:38PM -0400, Paul Gortmaker wrote:
> > The panic comes from the sanity test code, but after trying to boil down the
> > .config differences between the kitchen sink our test team uses, and a
> > "defconfig", it seems there are at least a couple extra dependencies for
> > creating a reproducer:
[...]
> >
> > rcu: Hierarchical SRCU implementation.
> > Kprobe smoke test: started
> > BUG: unable to handle page fault for address: ffffffffc110f3e7
> > #PF: supervisor instruction fetch in kernel mode
> > #PF: error_code(0x0010) - not-present page
> > PGD b2c60f067 P4D b2c60f067 PUD b2c611067 PMD 0
> > Oops: 0010 [#1] SMP NOPTI
> > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.57 #33
[...]
> Can you try the patch below?
[ 2.529263] rcu: Hierarchical SRCU implementation.
[ 2.530393] Kprobe smoke test: started
[ 2.555965] Kprobe smoke test: passed successfully
[ 2.556454] smp: Bringing up secondary CPUs ...
As per above, the same spot in the kprobe test seems to manage to not
panic anymore and the remainder of the boot looks clean and normal.
I tested directly on vanilla v5.15.57.
Thanks for the quick response!
Paul.
--
>
> Thanks.
> Cascardo.
>
> diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
> index 74c2f88a43d0..6bb479ce1ae4 100644
> --- a/arch/x86/kernel/ftrace.c
> +++ b/arch/x86/kernel/ftrace.c
> @@ -321,12 +321,12 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
> unsigned long offset;
> unsigned long npages;
> unsigned long size;
> - unsigned long retq;
> unsigned long *ptr;
> void *trampoline;
> void *ip;
> /* 48 8b 15 <offset> is movq <offset>(%rip), %rdx */
> unsigned const char op_ref[] = { 0x48, 0x8b, 0x15 };
> + unsigned const char retq[] = { RET_INSN_OPCODE, INT3_INSN_OPCODE };
> union ftrace_op_code_union op_ptr;
> int ret;
>
> @@ -364,15 +364,10 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size)
> goto fail;
>
> ip = trampoline + size;
> -
> - /* The trampoline ends with ret(q) */
> - retq = (unsigned long)ftrace_stub;
> if (cpu_feature_enabled(X86_FEATURE_RETHUNK))
> memcpy(ip, text_gen_insn(JMP32_INSN_OPCODE, ip, &__x86_return_thunk), JMP32_INSN_SIZE);
> else
> - ret = copy_from_kernel_nofault(ip, (void *)retq, RET_SIZE);
> - if (WARN_ON(ret < 0))
> - goto fail;
> + memcpy(ip, retq, sizeof(retq));
>
> /* No need to test direct calls on created trampolines */
> if (ops->flags & FTRACE_OPS_FL_SAVE_REGS) {
next prev parent reply other threads:[~2022-08-06 0:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-05 20:04 v5.15.57 regression - boot panic after retbleed backports with CONFIG_KPROBES_SANITY_TEST=y Paul Gortmaker
2022-08-05 21:13 ` Thadeu Lima de Souza Cascardo
2022-08-06 0:11 ` Paul Gortmaker [this message]
2022-08-08 13:48 ` Greg Kroah-Hartman
2022-08-16 4:12 ` Paul Gortmaker
2022-08-16 7:29 ` Thadeu Lima de Souza Cascardo
2022-08-16 13:47 ` Paul Gortmaker
2022-08-16 8:26 ` [PATCH 1/3] Revert "x86/ftrace: Use alternative RET encoding" Thadeu Lima de Souza Cascardo
2022-08-16 8:26 ` [PATCH 2/3] x86/ibt,ftrace: Make function-graph play nice Thadeu Lima de Souza Cascardo
2022-08-16 8:26 ` [PATCH 3/3] x86/ftrace: Use alternative RET encoding Thadeu Lima de Souza Cascardo
2022-08-16 9:18 ` [PATCH 1/3] Revert "x86/ftrace: Use alternative RET encoding" Greg KH
2022-08-16 10:16 ` Thadeu Lima de Souza Cascardo
2022-08-16 10:23 ` Greg KH
2022-08-19 11:16 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220806001100.GD42579@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=bp@suse.de \
--cc=cascardo@canonical.com \
--cc=gregkh@linuxfoundation.org \
--cc=jpoimboe@kernel.org \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).