All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Sasha Levin <sashal@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	peterz@infradead.org, stable@vger.kernel.org
Subject: Re: [PATCH v2 1/9] x86/kprobes: Prohibit probing on optprobe template code
Date: Tue, 22 Jan 2019 18:41:31 +0900	[thread overview]
Message-ID: <20190122184131.f13bd5f96092ca1839dce4b5@kernel.org> (raw)
In-Reply-To: <20190116133559.8FBCB2082F@mail.kernel.org>

On Wed, 16 Jan 2019 13:35:58 +0000
Sasha Levin <sashal@kernel.org> wrote:

> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: 9326638cbee2 kprobes, x86: Use NOKPROBE_SYMBOL() instead of __kprobes annotation.
> 
> The bot has tested the following trees: v4.20.2, v4.19.15, v4.14.93, v4.9.150, v4.4.170, v3.18.132.
> 
> v4.20.2: Build OK!
> v4.19.15: Build OK!
> v4.14.93: Build OK!
> v4.9.150: Build failed! Errors:
>     ./include/linux/kprobes.h:494:22: error: initializer element is not constant
>     ./include/linux/kprobes.h:494:22: error: initializer element is not constant
>     ./include/linux/kprobes.h:494:22: error: initializer element is not constant
>     ./include/linux/kprobes.h:494:22: error: initializer element is not constant

Ah, this is related to

commit 54a7d50b9205 ("x86: mark kprobe templates as character arrays, not single characters")

Before this change, I used & optprobe_template_*, so it the patch should be

+NOKPROBE_SYMBOL(optprobe_template_func);
+NOKPROBE_SYMBOL(&optprobe_template_entry);
+NOKPROBE_SYMBOL(&optprobe_template_val);
+NOKPROBE_SYMBOL(&optprobe_template_call);
+NOKPROBE_SYMBOL(&optprobe_template_end);

(since optprobe_template_func is a function symbol, it doesn't need &)

> 
> v4.4.170: Failed to apply! Possible dependencies:
>     21266be9ed54 ("arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug")
>     44a95dae1d22 ("KVM: x86: Detect and Initialize AVIC support")
>     520040146a0a ("KVM: x86: Use vector-hashing to deliver lowest-priority interrupts")
>     5881f73757cc ("svm: Introduce AMD IOMMU avic_ga_log_notifier")
>     5c919412fe61 ("kvm/x86: Hyper-V synthetic interrupt controller")
>     6308630bd3db ("kvm/x86: split ioapic-handled and EOI exit bitmaps")
>     c0dd671686b2 ("objtool: Mark non-standard object files and directories")
>     c207aee48037 ("objtool, x86: Add several functions and files to the objtool whitelist")
>     c6d308534aef ("UBSAN: run-time undefined behavior sanity checker")
>     d62caabb41f3 ("kvm/x86: per-vcpu apicv deactivation support")
>     f876f440df39 ("crypto: sha256-mb - SHA256 multibuffer job manager and glue code")

OK, commit 935893a17a99 ("objtool, x86: Add several functions and files to the objtool whitelist")
introduced optprobe_template_func, so for v4.4.X and v3.18.X, we don't need the first line.
So the patch should be something like,

                        "optprobe_template_end:\n");

+NOKPROBE_SYMBOL(&optprobe_template_entry);
+NOKPROBE_SYMBOL(&optprobe_template_val);
+NOKPROBE_SYMBOL(&optprobe_template_call);
+NOKPROBE_SYMBOL(&optprobe_template_end);
+
 #define TMPL_MOVE_IDX \
         ((long)&optprobe_template_val - (long)&optprobe_template_entry)


> 
> v3.18.132: Failed to apply! Possible dependencies:
>     0b24becc810d ("kasan: add kernel address sanitizer infrastructure")
>     131484c8da97 ("x86/debug: Remove perpetually broken, unmaintainable dwarf annotations")
>     24933b82c0d9 ("x86/asm/entry: Rename 'init_tss' to 'cpu_tss'")
>     76f5df43cab5 ("x86/asm/entry/64: Always allocate a complete "struct pt_regs" on the kernel stack")
>     8ef46a672a7d ("x86/asm/entry: Add this_cpu_sp0() to read sp0 for the current cpu")
>     905a36a28518 ("x86/asm/entry: Move entry_64.S and entry_32.S to arch/x86/entry/")
>     9d0c914c60f4 ("x86/asm/entry/64/compat: Change the 32-bit sysenter code to use sp0")
>     a232e3d558ee ("x86/asm/entry/32: Update "interrupt off" comments")
>     b87cf63e2a5f ("x86/asm/entry: Add comments about various syscall instructions")
>     c0dd671686b2 ("objtool: Mark non-standard object files and directories")
>     c207aee48037 ("objtool, x86: Add several functions and files to the objtool whitelist")
>     c63f06dd1579 ("kasan: move KASAN_SANITIZE in arch/x86/boot/Makefile")
>     ef7f0d6a6ca8 ("x86_64: add KASan support")
>     f876f440df39 ("crypto: sha256-mb - SHA256 multibuffer job manager and glue code")
> 
> 
> How should we proceed with this patch?

I'll send backport patches for those versions.

Thank you,

> 
> --
> Thanks,
> Sasha


-- 
Masami Hiramatsu <mhiramat@kernel.org>

  parent reply	other threads:[~2019-01-22  9:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-12  2:25 [PATCH v2 0/9] kprobes: Fix and improve blacklist symbols Masami Hiramatsu
2019-01-12  2:26 ` [PATCH v2 1/9] x86/kprobes: Prohibit probing on optprobe template code Masami Hiramatsu
     [not found]   ` <20190116133559.8FBCB2082F@mail.kernel.org>
2019-01-22  9:41     ` Masami Hiramatsu [this message]
2019-01-12  2:26 ` [PATCH v2 2/9] x86/kprobes: Move trampoline code into RODATA Masami Hiramatsu
2019-01-12  2:27 ` [PATCH v2 3/9] x86/kprobes: Prohibit probing on functions before kprobe_int3_handler() Masami Hiramatsu
2019-01-12  2:27 ` [PATCH v2 4/9] x86/kprobes: Prohibit probing on IRQ handlers directly Masami Hiramatsu
2019-01-12  2:28 ` [PATCH v2 5/9] kprobes: Search non-suffixed symbol in blacklist Masami Hiramatsu
2019-01-14 16:16   ` Steven Rostedt
2019-01-12  2:28 ` [PATCH v2 6/9] kprobes: Prohibit probing on hardirq tracers Masami Hiramatsu
2019-01-12  2:28 ` [PATCH v2 7/9] kprobes: Prohibit probing on preempt_check debug functions Masami Hiramatsu
2019-01-12  2:29 ` [PATCH v2 8/9] kprobes: Prohibit probing on RCU debug routine Masami Hiramatsu
2019-01-12  2:29 ` [PATCH v2 9/9] kprobes: Prohibit probing on lockdep functions Masami Hiramatsu
2019-01-12 13:33 ` [PATCH v2 0/9] kprobes: Fix and improve blacklist symbols Andrea Righi
2019-01-13 14:23   ` Masami Hiramatsu
2019-01-14 16:18 ` Steven Rostedt
2019-02-01 13:31   ` Masami Hiramatsu
2019-02-11 13:50     ` Ingo Molnar
2019-02-12 16:48       ` Masami Hiramatsu

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=20190122184131.f13bd5f96092ca1839dce4b5@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sashal@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.