LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Quentin Monnet <quentin.monnet@netronome.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Network Development <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: nfp: bpf: perf event output helpers support
Date: Thu, 7 Jun 2018 12:13:49 -0700	[thread overview]
Message-ID: <CAGXu5jJ7bygKKAzq-cP85XjB1OLzGAX6qr2VdCbSJ9_ZD=CZEw@mail.gmail.com> (raw)
In-Reply-To: <20180607093340.1742a5d1@cakuba.netronome.com>

On Thu, Jun 7, 2018 at 9:33 AM, Jakub Kicinski
<jakub.kicinski@netronome.com> wrote:
> On Wed, 6 Jun 2018 22:15:04 -0700, Kees Cook wrote:
>> > +       rcu_read_lock();
>> > +       if (!rhashtable_lookup_fast(&bpf->maps_neutral, &map,
>> > +                                   nfp_bpf_maps_neutral_params)) {
>> > +               rcu_read_unlock();
>> > +               pr_warn("perf event: dest map pointer %px not recognized, dropping event\n",
>> > +                       map);
>>
>> Please don't use %px on kernel pointers unless you absolutely have
>> to[1]. It seems like this value wouldn't be actionable here, so likely
>> it's best to just remove its use entirely.
>
> We're using kernel pointer as an opaque handle when communicating with
> the device.  We need the actual value to correlate things.  Maybe I used
> the %px slightly out of spite there, because I forgot %p is now useless
> and wasted half an hour on debugging an endian issue :S
>
> This message can only really trigger when root loads a specific BPF map
> onto the device and FW is buggy.  Can I fix it in -next?  I'm making
> changes to this part of the code anyway.

That'd be fine by me, thanks!

-Kees

-- 
Kees Cook
Pixel Security

      reply	other threads:[~2018-06-07 19:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07  5:15 Kees Cook
2018-06-07 16:33 ` Jakub Kicinski
2018-06-07 19:13   ` Kees Cook [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='CAGXu5jJ7bygKKAzq-cP85XjB1OLzGAX6qr2VdCbSJ9_ZD=CZEw@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=daniel@iogearbox.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=quentin.monnet@netronome.com \
    --subject='Re: nfp: bpf: perf event output helpers support' \
    /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

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).