From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Masami Hiramatsu <mhiramat@kernel.org>
Cc: bpf@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, Nicholas Piggin <npiggin@gmail.com>
Subject: [PATCH 2/3] bpf/trampoline: Allow ftrace location to differ from trampoline attach address
Date: Thu, 17 Feb 2022 17:06:24 +0530 [thread overview]
Message-ID: <2a32e4723f7e56c675ffd6aa0762789e56dce2e1.1645096227.git.naveen.n.rao@linux.vnet.ibm.com> (raw)
In-Reply-To: <cover.1645096227.git.naveen.n.rao@linux.vnet.ibm.com>
On some architectures, ftrace location can include multiple
instructions, and does not necessarily match the function entry address
returned by kallsyms_lookup(). Drop the check in is_ftrace_location() to
accommodate the same.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
kernel/bpf/trampoline.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
index 4b6974a195c138..c47c80874bee3f 100644
--- a/kernel/bpf/trampoline.c
+++ b/kernel/bpf/trampoline.c
@@ -124,8 +124,6 @@ static int is_ftrace_location(void *ip)
addr = ftrace_location((long)ip);
if (!addr)
return 0;
- if (WARN_ON_ONCE(addr != (long)ip))
- return -EFAULT;
return 1;
}
--
2.35.1
next prev parent reply other threads:[~2022-02-17 11:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 11:36 [PATCH 0/3] powerpc/ftrace: Reserve instructions from function entry for ftrace Naveen N. Rao
2022-02-17 11:36 ` [PATCH 1/3] " Naveen N. Rao
2022-02-17 19:46 ` kernel test robot
2022-02-21 0:10 ` Masami Hiramatsu
2022-02-17 11:36 ` Naveen N. Rao [this message]
2022-02-17 11:36 ` [PATCH 3/3] kprobes: Allow probing on any address belonging to ftrace Naveen N. Rao
2022-02-18 6:45 ` Naveen N. Rao
2022-02-21 0:15 ` 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=2a32e4723f7e56c675ffd6aa0762789e56dce2e1.1645096227.git.naveen.n.rao@linux.vnet.ibm.com \
--to=naveen.n.rao@linux.vnet.ibm.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mhiramat@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=rostedt@goodmis.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).