[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGXu5jJ7bygKKAzq-cP85XjB1OLzGAX6qr2VdCbSJ9_ZD=CZEw@mail.gmail.com>
Date: Thu, 7 Jun 2018 12:13:49 -0700
From: Kees Cook <keescook@...omium.org>
To: Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc: Quentin Monnet <quentin.monnet@...ronome.com>,
Daniel Borkmann <daniel@...earbox.net>,
Network Development <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: nfp: bpf: perf event output helpers support
On Thu, Jun 7, 2018 at 9:33 AM, Jakub Kicinski
<jakub.kicinski@...ronome.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
Powered by blists - more mailing lists