Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3061701yba; Mon, 6 May 2019 16:31:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRTGkq+n8pNtzGsoWH80kKdiNUpFmoyAN5xaOy000MF7cbT1Y74GO4mmhDCDJzh1zCtff1 X-Received: by 2002:aa7:8a8d:: with SMTP id a13mr38084997pfc.2.1557185507966; Mon, 06 May 2019 16:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557185507; cv=none; d=google.com; s=arc-20160816; b=Pwky6DpV+LIxT1xTUJR+SQ3MWSV6Pphv7SWiAvvCZoLRQGw0TW+sPE1ajKrtMV1e2Q 9xNGDZQ3FzbbaRl3lToKO1yB1j36RFMsrQGTvp7vL6CoDkvgWXeyWLjXvBN2Y2AgWpP8 MauRtzalHADGeeMUdhYwcTR6Ll7uxzu3l06NyzqcRSfDcLEYoacXx9tKsCjFcyY5dXwD itqAU3HiTZHKXfAAZFZp1u+nFh9GUSHFBalGRA8p9qhzCV+OEajOLJ/q7r39iGNdAhE3 AejAq/detuEahUZXeZ4mzcB0YhIm+muA4RcFezSRTty6UgwYUgBI9qVnjny1oUuxSYKp vHug== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Kd/ivxPvMEqS7Gvxxr7cAL/yd84pjS21skHKGj5n/zQ=; b=eiOJm7EgZPwyWdIpa+0OLFESmebVxxMKuI9sFELOMAl3xxH6jpiPqByAUlZYm2XLQX f1Vi3Qvh+8HKZIej3s1kNYSVrj9N7Os9dpX8L5hI7MDhW8QgV9XQgHF1sBnY2qNi2BxQ zXQpO9+SivZRgiUeLqzdpZ5I3bMktq4t+5lwYnCPBa0rNkRHDxm8PPpXrNeS9/7CDEC/ lDcvG1dL5UV0lzqQB8FDYo9XIYYIdAlTWrKnyAE7+xN7ql2G3lDGQHOmRLCpVE6X0WZb rv9sFy0iy8ddu78qLP8lO0SjUWzTSfGaLQJb7M/+u3NW7Cm45U7EccZlzDAkG/VJtqqZ raqg== ARC-Authentication-Results: i=1; mx.google.com; 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 d11si2690029pgt.76.2019.05.06.16.31.33; Mon, 06 May 2019 16:31:47 -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; 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 S1726370AbfEFXai (ORCPT + 99 others); Mon, 6 May 2019 19:30:38 -0400 Received: from www62.your-server.de ([213.133.104.62]:49720 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbfEFXah (ORCPT ); Mon, 6 May 2019 19:30:37 -0400 Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1hNmkx-0007So-C5; Tue, 07 May 2019 01:10:47 +0200 Received: from [178.199.41.31] (helo=linux.home) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1hNmkx-00061k-4J; Tue, 07 May 2019 01:10:47 +0200 Subject: Re: [PATCH v2 1/4] bpf: Add support for reading user pointers To: Joel Fernandes Cc: linux-kernel@vger.kernel.org, Michal Gregorczyk , Adrian Ratiu , Mohammad Husain , Qais Yousef , Srinivas Ramana , duyuchao , Manjo Raja Rao , Karim Yaghmour , Tamir Carmeli , Yonghong Song , Alexei Starovoitov , Brendan Gregg , Masami Hiramatsu , Peter Ziljstra , Andrii Nakryiko , Steven Rostedt , Kees Cook , kernel-team@android.com, bpf@vger.kernel.org, Ingo Molnar , Martin KaFai Lau , netdev@vger.kernel.org, Song Liu References: <20190506183116.33014-1-joel@joelfernandes.org> <3c6b312c-5763-0d9c-7c2c-436ee41f9be1@iogearbox.net> <20190506195711.GA48323@google.com> From: Daniel Borkmann Message-ID: <7e0d07af-79ad-5ff3-74ce-c12b0b9b78cd@iogearbox.net> Date: Tue, 7 May 2019 01:10:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20190506195711.GA48323@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.100.3/25441/Mon May 6 10:04:24 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/06/2019 09:57 PM, Joel Fernandes wrote: > On Mon, May 06, 2019 at 09:11:19PM +0200, Daniel Borkmann wrote: >> On 05/06/2019 08:31 PM, Joel Fernandes (Google) wrote: >>> The eBPF based opensnoop tool fails to read the file path string passed >>> to the do_sys_open function. This is because it is a pointer to >>> userspace address and causes an -EFAULT when read with >>> probe_kernel_read. This is not an issue when running the tool on x86 but >>> is an issue on arm64. This patch adds a new bpf function call based >>> which calls the recently proposed probe_user_read function [1]. >>> Using this function call from opensnoop fixes the issue on arm64. >>> >>> [1] https://lore.kernel.org/patchwork/patch/1051588/ >>> >>> Cc: Michal Gregorczyk >>> Cc: Adrian Ratiu >>> Cc: Mohammad Husain >>> Cc: Qais Yousef >>> Cc: Srinivas Ramana >>> Cc: duyuchao >>> Cc: Manjo Raja Rao >>> Cc: Karim Yaghmour >>> Cc: Tamir Carmeli >>> Cc: Yonghong Song >>> Cc: Alexei Starovoitov >>> Cc: Brendan Gregg >>> Cc: Masami Hiramatsu >>> Cc: Peter Ziljstra >>> Cc: Andrii Nakryiko >>> Cc: Steven Rostedt >>> Cc: Kees Cook >>> Cc: kernel-team@android.com >>> Signed-off-by: Joel Fernandes (Google) >>> --- >>> Masami, could you carry these patches in the series where are you add >>> probe_user_read function? >>> >>> Previous submissions is here: >>> https://lore.kernel.org/patchwork/patch/1069552/ >>> v1->v2: split tools uapi sync into separate commit, added deprecation >>> warning for old bpf_probe_read function. >> >> Please properly submit this series to bpf tree once the base >> infrastructure from Masami is upstream. > > Could you clarify what do you mean by "properly submit this series to bpf > tree" mean? bpf@vger.kernel.org is CC'd. Yeah, send the BPF series to bpf@vger.kernel.org once Masami's patches have hit mainline, and we'll then route yours as fixes the usual path through bpf tree. >> This series here should >> also fix up all current probe read usage under samples/bpf/ and >> tools/testing/selftests/bpf/. > > Ok. Agreed, will do that. Great, thanks! Daniel