Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2533375imm; Thu, 7 Jun 2018 12:15:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKcVJNCBIqPMZUlKAvsJyBkHb3vseOc0H0GwWeNjC+uGhKFjCKZ5c3nwlUQweOgYmCqGcz9 X-Received: by 2002:a65:4287:: with SMTP id j7-v6mr2625978pgp.144.1528398933977; Thu, 07 Jun 2018 12:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528398933; cv=none; d=google.com; s=arc-20160816; b=QBgklfCM643GkNoeklY4jyk4icZ2qAPWrgtWEKYGjjf2BhtceQkx1T8ItW/Qe9l2Ji WW8qKMhvUeEBG08OGs9L8qisJ2vuZPhrdl0esy8BvkUBaeUZ/qGW099O6H/d0NEa0//J 7rNhcs3D5xqTuRR/ownXac2CLq5XF8T0lswmm/e4ed6kz5iYYaGi121xSO7ax5LMZQ05 JrgLzurUABvwM4ayah0RudIH7lT6sZWxwlh+bnvAvk79WQAUkdiG9HPaA5ZEbqE5c9EU /YdmCGEVME5d/lhKDXOCxG/gimMWWxGg7ObehNG31ercPSQ2xyu4M3IMe13kW/ZFt8vg DlCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=qMTtbpS2k5Fyc/Cx+AKDMBTNK2lgaWBCdtq5e/pp2tk=; b=qYDJ2fxlWWAXXQ2pWtbkRns7eArJxbMxuIDmLBfxYUMCg1P1x0U7gHqtquIqjQteG9 ly1s8jcErWeS8Gu3um50D81bQA4xrZtuJaLx2fkGl2x1vVyk8S3CchmcU890BK+sRaAI A/q9YJGqswN3V5ZevNoAlrSfiSXT7dpU0s20L1qhPI8ke1ihp2snE3KGLpMvcZeTBNao ppbCzu/jJmi/29/o2FFSYsgXiNXIK23oFkFccBJgNbmmhJUHCH9KmU5mbhGyimi84gwR PnmBEAu6Jlt2x8afbPZXUpBUlkdDfEHwrjRU1Vtj8hNiBmZRe/ejgJLUwj1vYhoNKRvf wDow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=b6ZhGjYo; dkim=fail header.i=@chromium.org header.s=google header.b=lAJrtzHF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r18-v6si43052455pgd.143.2018.06.07.12.15.19; Thu, 07 Jun 2018 12:15:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=b6ZhGjYo; dkim=fail header.i=@chromium.org header.s=google header.b=lAJrtzHF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752520AbeFGTNw (ORCPT + 99 others); Thu, 7 Jun 2018 15:13:52 -0400 Received: from mail-ua0-f193.google.com ([209.85.217.193]:37894 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750927AbeFGTNv (ORCPT ); Thu, 7 Jun 2018 15:13:51 -0400 Received: by mail-ua0-f193.google.com with SMTP id 59-v6so7263734uas.5 for ; Thu, 07 Jun 2018 12:13:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qMTtbpS2k5Fyc/Cx+AKDMBTNK2lgaWBCdtq5e/pp2tk=; b=b6ZhGjYoRTKib4dOzZf+AZw4Jrt6xwWCf9seYBfv8MLJOY69qSTnFhL6JBIT/Km9GM J+gDDSbYVHc0Hx3talgWmguAjk/iN7GSx3FdZzC3eKOyHcrTyLoKtWuwGDdPAYrycy7s zCGu0iUVkepwpT+OAjse1ScPFWm1gefh03kL+2zxJY01sWcvjnd571IpoMChYJRVv1Iv 2A3g+UyJ2Fkv8B6hoeUaNmVjd36XAUmbC2Fv6VHh6XdwFjEW9K3XJRTAEZ7XDYPOKMZo EO/b3aclosXNN8TcJJPfLLY9Tc31S/RQtHzTCPJ95cgHAKq9nErFSVmFDOrW9MpGu3NO sORQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qMTtbpS2k5Fyc/Cx+AKDMBTNK2lgaWBCdtq5e/pp2tk=; b=lAJrtzHFllDpg5CdViBirjTHumRc475XfncHTDMWM89Bgv/ZOkWeVH23js4VyEzbHN hRElHfbTRDEyU9HmsXpsrE6igC5mwuMEgxt7NpvIamhAK4Gtf/mmrS5jcXSfsPSfCqfJ 2GitSE2H++RSg4DkNtGCkJixLwXKVeLzttgbU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=qMTtbpS2k5Fyc/Cx+AKDMBTNK2lgaWBCdtq5e/pp2tk=; b=rXVP2UemvoDXqghUdvAgoHPed6UQuPIAZYPJXMtox/BidnGdQ3qcA5tiDzi0KRjEEG iDsRN8hQwBK2LfX9ieUkazDqeJq65QE7RxjzbnQkN9jTJLYQkwQm99xDyxcWF7zlgqfs 5a+JgdQ5riDZwzB+wzpKpzOPOFzXq9l84mxFqMBYHoY7RqFxAUQT1TJj3Gcucr/iDI80 9zy4reC0o5rDwnXgh46rMTihsjJR2hj1LLyVPgDpnJH7gTjDzCWr4WZa9QhHIdBUd0cQ jxGO6uxD7kCcOUYk2P7w2Q6TYZa5Sdq87z8NMC1C9EZmU62GOxYK6sbm5xC96zGNVArj Evcw== X-Gm-Message-State: APt69E3IhzaU+Lk6cGDJVZn4rydBu4PfcAkHw+l0sSKcsW7B16jeKjWt HvVfLpK1Ls4mnvPqs4ZEt6WExi7HqeIwzIkdSc5IxA== X-Received: by 2002:ab0:663:: with SMTP id f90-v6mr2099883uaf.167.1528398830081; Thu, 07 Jun 2018 12:13:50 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1f:a085:0:0:0:0:0 with HTTP; Thu, 7 Jun 2018 12:13:49 -0700 (PDT) In-Reply-To: <20180607093340.1742a5d1@cakuba.netronome.com> References: <20180607093340.1742a5d1@cakuba.netronome.com> From: Kees Cook Date: Thu, 7 Jun 2018 12:13:49 -0700 X-Google-Sender-Auth: -sWb8MfGX94iKwqWXmK89G7wKC8 Message-ID: Subject: Re: nfp: bpf: perf event output helpers support To: Jakub Kicinski Cc: Quentin Monnet , Daniel Borkmann , Network Development , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 7, 2018 at 9:33 AM, Jakub Kicinski 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