Received: by 10.223.164.202 with SMTP id h10csp472110wrb; Fri, 10 Nov 2017 09:15:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMbBWK7SaAuOUDcX7XnfvEGEuuZ4LaXdCx5I9iynkZ7Bh4ey5Y90M1uuG9KFcf8zmZYTT9aH X-Received: by 10.84.236.12 with SMTP id q12mr1057996plk.204.1510334128066; Fri, 10 Nov 2017 09:15:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510334128; cv=none; d=google.com; s=arc-20160816; b=xMUqrHd7gccCVSrmMmRIAQ09U3QxBcLvizDHb7lMfG2ofLdcCTfiBN/qP91yw6AP1f bcSrox5D7roo/SSCF/BK4yc9woDu/zGI3roSsp14ORFKbnffqnFkSOT0AaiNqycjYCAg EtVxI/AVWPDp1dm4xGEKK8xcMHx/BEn5aKXZBeMfaNMLWmLToPt0bvpoNzGhyF/UzWyz Q5mgmejJMuboy1dPgRl98N1w/2366nXbrjJhc3gW7YGh3iykPrxrQhoRtF4gU//bY46z AaLNxBzt0yShoboXldu7N6E/ki4ZzyuHBSogsKxu9+XQrZKcokgcSxCXSxm59Qnt9sli aNrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=A/Li+Y/FI+SAAUpd/2N/Hvoplt6f+WvmtQmwLMMe+48=; b=DkhLMYhzUBGYY7to8rk437e7q249q26bz46YWph43+fk+o1k6dwGu13+bpYqLximq6 8HspTzapyURIrxhOo9czrIwMevjH4vPsbH9wH2px4F3YhTFUaJRUzKlLRLFdSMxdYeyo Vjhy9+wmYTasleH6y+c0AxfYYaEx094t0nXp00CC9ZWdtHFx/Kr1fxrBp9wPpTo7CCBJ LyIrKfXdCE6MNbEuQKyHX0AHyTd6U0FYl1IFxbrfU2U4Wn2Aiu/l2TwwnCMmPSunXQn8 dxq1T2dTGAQEa+ULa5VTw3N8ktVKMxDJ3bn5f6EpxeTOUTMy99w+005EZJHon21l0a4O 3aHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=yxUV/Z9Y; 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 z21si9095490plo.214.2017.11.10.09.15.16; Fri, 10 Nov 2017 09:15:28 -0800 (PST) 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=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=yxUV/Z9Y; 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 S1753498AbdKJROe (ORCPT + 82 others); Fri, 10 Nov 2017 12:14:34 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:44937 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753432AbdKJROb (ORCPT ); Fri, 10 Nov 2017 12:14:31 -0500 Received: by mail-qt0-f193.google.com with SMTP id 8so12661523qtv.1 for ; Fri, 10 Nov 2017 09:14:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=A/Li+Y/FI+SAAUpd/2N/Hvoplt6f+WvmtQmwLMMe+48=; b=yxUV/Z9YFY3RrSdG9Z1x9T6RSQRtp3sWpXL+WNQNcwakKKV38SO2dzUitSpXqjGC4c VaS3mwSA5dDERJYHiobkthx4gis+yGZrFzhU/FX8iB0uduf2TRNRM7W8+AG1zYwBujHe h+YYQBQ1BEW1y+AlCQugL5plJPJrCLsb8eYzKch+wwVo2yqqCXkECUXc9qKV8tA/2Yvl F81bfEBVE8Hi6XAiHrWfnFm42CKrnA17Z3Vbq3hAAGhG35hkrlW5A4g5Nw30xdnJd+z8 xDkAsdl91bL/UHd4URuTlO0V1uwT/RL/HAvSiVY/lO9LNhVr69PosYsb2tftbrCEigIv WZMg== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=A/Li+Y/FI+SAAUpd/2N/Hvoplt6f+WvmtQmwLMMe+48=; b=jAscUlIPa/NPoVlgzD7MHPhRIViaD+sj0gzL3jfgTIv3yncBzQAjBXWIL7kX2XTQVN m/tRRPzpc4wsVSwGtbiZtkhVBY1HdX9elWI3IbrZT7P78MemBeLez+k9nbyp2BA51Ky3 1IYihD/CV1AwqyB5tXaiCjziBUjWDU5SrHT5IWVzZ2PNVw/+MRi0nxDsL6cbTDVXTK0l Dhsoks+pZ0aMosvo5uhR9OAOfS9VWwKsVZvtNjMt5JBW9iI4bJkbIgnVssa4J1QpA5XC 3qX9YsgaT4RFDVPsxCJ3siZgXzuFWr+wIfzsslbk9QJuKXPVbc1fAqLlI4BVmxIK/WaE iwRw== X-Gm-Message-State: AJaThX6CbMo3x4FWMf35OLHYzm3rKt7DnbCM8o8q7KLooZGL9tppvnHB Dl+z5KjI9/KHYFfDmLhklJdH4w== X-Received: by 10.200.34.239 with SMTP id g44mr1614037qta.111.1510334070779; Fri, 10 Nov 2017 09:14:30 -0800 (PST) Received: from localhost (cpe-2606-A000-4381-1201-225-22FF-FEB3-E51A.dyn6.twc.com. [2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id v21sm6794003qtv.21.2017.11.10.09.14.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Nov 2017 09:14:30 -0800 (PST) Date: Fri, 10 Nov 2017 12:14:29 -0500 From: Josef Bacik To: Ingo Molnar Cc: Josef Bacik , rostedt@goodmis.org, mingo@redhat.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ast@kernel.org, kernel-team@fb.com, daniel@iogearbox.net, Josef Bacik Subject: Re: [PATCH 1/2] bpf: add a bpf_override_function helper Message-ID: <20171110171428.hrw5cpxy4sgzf7mn@destiny> References: <1510086523-8859-1-git-send-email-josef@toxicpanda.com> <1510086523-8859-2-git-send-email-josef@toxicpanda.com> <20171110093459.w2pvo3ntkwbmgnha@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171110093459.w2pvo3ntkwbmgnha@gmail.com> User-Agent: NeoMutt/20170714 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 10, 2017 at 10:34:59AM +0100, Ingo Molnar wrote: > > * Josef Bacik wrote: > > > @@ -551,6 +578,10 @@ static const struct bpf_func_proto *kprobe_prog_func_proto(enum bpf_func_id func > > return &bpf_get_stackid_proto; > > case BPF_FUNC_perf_event_read_value: > > return &bpf_perf_event_read_value_proto; > > + case BPF_FUNC_override_return: > > + pr_warn_ratelimited("%s[%d] is installing a program with bpf_override_return helper that may cause unexpected behavior!", > > + current->comm, task_pid_nr(current)); > > + return &bpf_override_return_proto; > > So if this new functionality is used we'll always print this into the syslog? > > The warning is also a bit passive aggressive about informing the user: what > unexpected behavior can happen, what is the worst case? > It's modeled after the other warnings bpf will spit out, but with this feature you are skipping a function and instead returning some arbitrary value, so anything could go wrong if you mess something up. For instance I screwed up my initial test case and made every IO submitted return an error instead of just on the one file system I was attempting to test, so all sorts of hilarity ensued. Thanks, Josef From 1583671210869608232@xxx Fri Nov 10 09:35:59 +0000 2017 X-GM-THRID: 1583463755336960738 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread