From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: nfp: bpf: perf event output helpers support Date: Thu, 7 Jun 2018 09:33:40 -0700 Message-ID: <20180607093340.1742a5d1@cakuba.netronome.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Quentin Monnet , Daniel Borkmann , Network Development , LKML To: Kees Cook Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org 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.