From: Florent Revest <revest@chromium.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
andrii@kernel.org, kpsingh@chromium.org, revest@google.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next 1/2] bpf: Add a bpf_kallsyms_lookup helper
Date: Tue, 01 Dec 2020 21:25:37 +0100 [thread overview]
Message-ID: <8fa6721528bbf8f7f59eb773f0cd899a32205a01.camel@chromium.org> (raw)
In-Reply-To: <20201201024106.k2jd5nysmokbymn5@ast-mbp>
On Mon, 2020-11-30 at 18:41 -0800, Alexei Starovoitov wrote:
> On Mon, Nov 30, 2020 at 05:23:22PM +0100, Florent Revest wrote:
> > On Sat, 2020-11-28 at 17:07 -0800, Alexei Starovoitov wrote:
> > > Looks like debug-only helper.
> > > I cannot think of a way to use in production code.
> > > What program suppose to do with that string?
> > > Do string compare? BPF side doesn't have a good way to do string
> > > manipulations.
> > > If you really need to print a symbolic name for a given address
> > > I'd rather extend bpf_trace_printk() to support %pS
> >
> > We actually use this helper for auditing, not debugging.
> > We don't want to parse /proc/kallsyms from userspace because we
> > have no guarantee that the module will still be loaded by the time
> > the event reaches userspace (this is also faster in kernelspace).
>
> so what are you going to do with that string?
> print it? send to user space via ring buffer?
We send our auditing events down to the userspace via a ring buffer and
then events are aggregated and looked at by security analysts. Having
the symbol and module names instead of a hex address makes these events
more meaningful.
> Where are you getting that $pc ?
I give an example in the commit description: we hook into callback
registration functions (for example, nf_register_net_hook), get the
callback address from the function arguments and log audit information
about the registered callback. For example, we want to know the name of
the module in which the callback belongs and the symbol name also helps
enrich the event.
prev parent reply other threads:[~2020-12-01 20:26 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-26 16:57 [PATCH bpf-next 1/2] bpf: Add a bpf_kallsyms_lookup helper Florent Revest
2020-11-26 16:57 ` [PATCH bpf-next 2/2] selftests/bpf: Add bpf_kallsyms_lookup test Florent Revest
2020-12-02 0:57 ` Andrii Nakryiko
2020-11-27 2:32 ` [PATCH bpf-next 1/2] bpf: Add a bpf_kallsyms_lookup helper KP Singh
2020-11-27 9:25 ` Florent Revest
2020-11-27 9:27 ` Florent Revest
2020-11-27 7:35 ` Yonghong Song
2020-11-27 9:20 ` Florent Revest
2020-11-27 11:20 ` KP Singh
2020-11-27 16:09 ` Yonghong Song
2020-12-02 0:55 ` Andrii Nakryiko
2020-12-02 20:32 ` Florent Revest
2020-12-02 21:18 ` Alexei Starovoitov
2020-12-11 14:40 ` Florent Revest
2020-12-14 6:47 ` Yonghong Song
2020-12-17 15:31 ` Florent Revest
2020-12-17 17:26 ` Yonghong Song
2020-12-18 3:20 ` Alexei Starovoitov
2020-12-18 4:39 ` Yonghong Song
2020-12-18 18:53 ` Andrii Nakryiko
2020-12-18 20:36 ` Alexei Starovoitov
2020-12-18 20:47 ` Andrii Nakryiko
2020-12-22 20:38 ` Florent Revest
2020-12-22 20:52 ` Florent Revest
2020-12-22 14:18 ` Christoph Hellwig
2020-12-22 20:17 ` Florent Revest
2020-12-23 7:50 ` Christoph Hellwig
2020-12-02 0:47 ` Andrii Nakryiko
2020-11-27 17:20 ` kernel test robot
2020-11-27 17:20 ` [RFC PATCH] bpf: bpf_kallsyms_lookup_proto can be static kernel test robot
2020-11-29 1:07 ` [PATCH bpf-next 1/2] bpf: Add a bpf_kallsyms_lookup helper Alexei Starovoitov
2020-11-30 16:23 ` Florent Revest
2020-12-01 2:41 ` Alexei Starovoitov
2020-12-01 20:25 ` Florent Revest [this message]
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=8fa6721528bbf8f7f59eb773f0cd899a32205a01.camel@chromium.org \
--to=revest@chromium.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kpsingh@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=revest@google.com \
/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).