Re: nfp: bpf: perf event output helpers support

From: Jakub Kicinski
Date: Thu Jun 07 2018 - 12:33:51 EST


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.