Received: by 10.223.164.202 with SMTP id h10csp1138004wrb; Sat, 11 Nov 2017 00:16:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMZUAP2Po2pCbovp5UT5Lv8gE4BHUW/KkuTfyn+tWldaF0gv8pZ9KvA7qIrMM+QNQFNLnXwn X-Received: by 10.159.196.151 with SMTP id c23mr3031676plo.276.1510388166266; Sat, 11 Nov 2017 00:16:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510388166; cv=none; d=google.com; s=arc-20160816; b=rmWJ0or7bbTFiO9OGMHVVmq0LpmEwjlDSnKVjlO6GXbEnj4VIscFz3c2wLsALifnPI QRZGHDijQlKNDcjNNlqbk8q5iRmqJcPlYBLxByTBJovROAWQuPeisf9Ui29xt0qqhf/x fPiv/OhZ2Q0+zr8wTYX4OhuUOFqS/ToKhWPV259+I2Kp6b8Xag7LANx35Qrm1Z2jyytH 13G2O1qT5gcetXy2f+Wj/zvbczA0L4Z+1cO1dJUZdvXkfNvduptpma//fyzI8RvUVtHj 3jJmPWttZhA4n2RYwCMoGHd4ToeMMA4SyHPN/SNXdyV3zsvAWBYDZDUafdotrEEJw7uR icPg== 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=M3+czS1ojWExt0zPenv4q0j5GGhvaGsikNd2kLH6ajI=; b=pObhgZ107s0j4hUk3cZTTHniOS1B3+tzwTRmH/QSJ3Hb6I+PG1fD0cTPhJVROokU5X Ktm18lYnHzq/Zl+QYvjnmVDSHs7g5D6Q+2Y722OfB97+izq8KjQbF+74NZxuhI8ep8e8 WOIXM4CH/r1aIA6BZwV8YjpOBD/uiBsY42TT1jEPFZaYvWT7avvtP3ikrgrvqQa1h7Tv JK/6yl0wnN4eqHxo8BW9XvkoD89OOVQC9BzjHwPNxzf61kfyhW0mC035pCLz8P5KG+TX bflmavg3aqDjiC8Ihe1JtDvKVz2VdcgoaBfTumJR1mb8yhX91rUm7Oint21cSOkyNuHy ztNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=jh9WQ60f; 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 a61si4890066plc.309.2017.11.11.00.15.55; Sat, 11 Nov 2017 00:16:06 -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=fail header.i=@gmail.com header.s=20161025 header.b=jh9WQ60f; 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 S1751858AbdKKIPB (ORCPT + 83 others); Sat, 11 Nov 2017 03:15:01 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:37921 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751636AbdKKIO7 (ORCPT ); Sat, 11 Nov 2017 03:14:59 -0500 Received: by mail-wm0-f65.google.com with SMTP id p75so6497573wmg.3; Sat, 11 Nov 2017 00:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=M3+czS1ojWExt0zPenv4q0j5GGhvaGsikNd2kLH6ajI=; b=jh9WQ60fYkEmT5PrDFAARqKFipqpRM+Nd0s1WNC8g6ur8cHGVTG91iAtiE1RhglaZq 7VEEw1Ez7/4qBVLqkWcjojZaEEQpNkg4eYY1aXUZlt9VyHQE0VgPFi2K81RD9qdxb7bA rrZMjP/AZCTB1qdiu0IwCI+8eSFwlCz2Ja8ILWkIIp7HSQg1f/Ys3gT4Z2lYWDSEZJiQ +zn4VujINpsktzSeTh3QT8ZK9HCwUM6T8G35IwN51xuKS6v2bJZfq83usHC+bzWQLj7z GNHr+OXrltDRUpZM9gaGAW5NkYQ+jrni+3pVASNasuU4GK8zpY5ZO70G5dS22bmC9pTZ eEuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=M3+czS1ojWExt0zPenv4q0j5GGhvaGsikNd2kLH6ajI=; b=qokDEEtSzPlL+XX85Xb11HPGDgpcUH1RIPPQv5HkY8eWurr3cOiIqPxW8s5wqWCPux ZiR57JosDDaQ+kv9aFdF02nYG0XAaQblzhxYbp7oN/oSf14nrbVSgNYzQEGH0iHuB+GY Px6IH9E1NJ8z/EBTbLdeHoggYeXdXRI1DvHXreO5aZmYDM8PLLBNqan15iQbV6q1t5PH +g+NYC2lkD3YpCA98OrouO0crqaWs2HrDITOvIynL9NaT4L3oNsSk0HIXNG1iyOIbs2B drj+pdNhrx1xUDoPLwUKc0zKRzCyhF4zlU/tPjky/W+Zh1M+Q5gbpYJtIn/nHn8r1OBt +tYA== X-Gm-Message-State: AJaThX71bHYlzq14+WBbK8RLKeD8OV65qVhenaQB7sYKZb4qlOQxSsqj 2tA1//ezKUxVeYguAfKArQI= X-Received: by 10.28.148.15 with SMTP id w15mr2001974wmd.140.1510388098347; Sat, 11 Nov 2017 00:14:58 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id f140sm2641974wmd.27.2017.11.11.00.14.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 Nov 2017 00:14:57 -0800 (PST) Date: Sat, 11 Nov 2017 09:14:55 +0100 From: Ingo Molnar To: Josef Bacik Cc: 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: <20171111081455.qx4rodxldofbzypb@gmail.com> References: <1510086523-8859-1-git-send-email-josef@toxicpanda.com> <1510086523-8859-2-git-send-email-josef@toxicpanda.com> <20171110093459.w2pvo3ntkwbmgnha@gmail.com> <20171110171428.hrw5cpxy4sgzf7mn@destiny> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171110171428.hrw5cpxy4sgzf7mn@destiny> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Josef Bacik wrote: > 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. Ok, then for the x86 bits: NAK-ed-by: Ingo Molnar One of the major advantages of having an in-kernel BPF sandbox is to never crash the kernel - and allowing BPF programs to just randomly modify the return value of kernel functions sounds immensely broken to me. (And yes, I realize that kprobes are used here as a vehicle, but the point remains.) Thanks, Ingo From 1583700118443169300@xxx Fri Nov 10 17:15:27 +0000 2017 X-GM-THRID: 1583463755336960738 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread