Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2517255imm; Thu, 7 Jun 2018 12:00:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJU+OEcx13nBB4oMribQ26AepX3sczgDAOuWYDaf5rHSMYfD24p+KjcvWj1gw6mOb4wRZQB X-Received: by 2002:a17:902:2c01:: with SMTP id m1-v6mr3198135plb.347.1528398059314; Thu, 07 Jun 2018 12:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528398059; cv=none; d=google.com; s=arc-20160816; b=KHw1tHtA+wuF/ZUkpXKSZqC9rQw3ArtrVJ5/oqVKcQgVBEerOgK96ZI/V4Qmk/DAvG PXtRy/UaaZdFVTar2AMa8Jzeu6a2wg4UK8ilhC6OJQHcww6HHQhQ7fG1m5rHLnQwprNL ooPxBZs0aOe9zp81MRwMRiSh7m6reodS2zPp2QQUSJKjM6Nh8cd1Jive7wOeyHVBdHsJ dpRo+0qxgVDW6AsibBlGxgPDXi/zoqOGqBTNyU1mlaJToponmf1EzcDPYFzN9YCTAu1u 1HbJAoiLIGuGfzglWqA+MwueEl3cHJ/AiCNhxVaOtiiIaxaHiigdHHtBku1IKPyRUt7L hMyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature:arc-authentication-results; bh=wWEPR9Sa9GTfTcdZvvpj0JHTiL37HlRwKc/VZW+efj0=; b=xRpbPjb3q9kK+YyXL2WCukF4ZNv1cBk3N6LhXwTn3dOiz5T1sDD9aExy1KC1u9tmfM Yndj07Z30bWGphMQPbGGoLMLFqYB+EuZZZHK8Y1rmlaFTWB3QekBVsdcYShS3GjZnExa XMJ5gGwSnSHy0jKdXpDovES2v8/RovTNuMG2YlsD3tOEWVrDav1VURsZs4K2S52xMnh0 gGDkzBKEJ13pJvO4UDzdC4DFyXJVBnLLCH3vUtz07RF+/q5T8pPTyiB4xueLPW+DlYLl iurwWf+wifYBH432ZJVT+hbotMwXHv37VDuefolprz1FL3XHj5PmabCzAq+gFzpleqOa f7xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=oGQ5A675; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k12-v6si30973427pll.319.2018.06.07.12.00.44; Thu, 07 Jun 2018 12:00:59 -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=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=oGQ5A675; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753927AbeFGQdr (ORCPT + 99 others); Thu, 7 Jun 2018 12:33:47 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:36959 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753909AbeFGQdp (ORCPT ); Thu, 7 Jun 2018 12:33:45 -0400 Received: by mail-pg0-f41.google.com with SMTP id r21-v6so4674542pgv.4 for ; Thu, 07 Jun 2018 09:33:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=wWEPR9Sa9GTfTcdZvvpj0JHTiL37HlRwKc/VZW+efj0=; b=oGQ5A675lUOoXJoWAl0kPBa/gzb58NU5zr8R7c6I3urWpo7IqU5+Uw4EH/IZcm5ZFz 7LyCj8hUK85yDBnf6Lk/hh9O9bxp4U/1OXTHz3hJA47rnZb2euMPeKjhySHhhdKOeupk jdIbaN2wUi01OTT1pexm9MNGtIzqS+xbPYfWTTImtgmbPqB+NngG+6INvyxMlFlCBzKF lYJtmLCbeGqjNmX9YwTDGEa++tkkiYdahpvj68M0cOUYaoS48u7jQdjJD+P5FnnGGslJ 3+vMxd8ekfZwsDoyH1tyq2tzpvY/Cf9ms0sg52zqQalqK8rEhPWYJslxHIPcQ1A83wrM +fQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=wWEPR9Sa9GTfTcdZvvpj0JHTiL37HlRwKc/VZW+efj0=; b=omxM89SVu1XeacX+e4ulXzGkHT0XUgaLr/VRBHlk9Q/zQbRxic2nFssk0ZNsZxv15I vS7iKZ4mltLVrgRfAu8RLXOM2mwEVoxcfHuPhP3nn15zjU0vTtij6Fi47mvx6SJ4HuZH oxd1EUVNSUs4QiIUtLrQCmOzMDvYS45VbVA9Gy6cMpJtPUmE3QVVQJMCjfSGvI+oeRn8 HAa2EWCbRihBBb9xiWcmtNJo8WuP8A7x85DaA5cu1uUchY9SQ6kAmudu/Me1/Hq+f/53 kpct6lrpGjw8GGDRgbJ7oeWKO/Pah1DiaBBM4mTjJbocla/FUbno0DxTynconrCmDJnO gNSg== X-Gm-Message-State: APt69E1vUqIo9INlbBqidCgYLvCnLryYLxzSrT72UsVsPqWcgYhSSEqZ yNxCTAG8DDwVxW4rSQ7HeKl9mA== X-Received: by 2002:a63:2ac4:: with SMTP id q187-v6mr2218997pgq.333.1528389224689; Thu, 07 Jun 2018 09:33:44 -0700 (PDT) Received: from cakuba.netronome.com ([75.53.12.129]) by smtp.gmail.com with ESMTPSA id 131-v6sm97398685pfa.128.2018.06.07.09.33.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Jun 2018 09:33:44 -0700 (PDT) Date: Thu, 7 Jun 2018 09:33:40 -0700 From: Jakub Kicinski To: Kees Cook Cc: Quentin Monnet , Daniel Borkmann , Network Development , LKML Subject: Re: nfp: bpf: perf event output helpers support Message-ID: <20180607093340.1742a5d1@cakuba.netronome.com> In-Reply-To: References: Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.