Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2847620yba; Mon, 6 May 2019 12:31:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqykg6hHYd3mSylR72RLRuruyLDjK4uInIkgqz9PhchU72w5SzrCjR0zJaVSnqjeFGtINCsi X-Received: by 2002:a62:fb0f:: with SMTP id x15mr36258823pfm.30.1557171108495; Mon, 06 May 2019 12:31:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557171108; cv=none; d=google.com; s=arc-20160816; b=Jx1QTVdNhOLqvxAjsk27L++NExmESS3lI29dnDZzlcSAOF5SIwatKujv3mXqgp4yyH 92CRDgkKW1+m5UFDx9OEcPMJAKL1uCnmWtEV52VhsjsjD0glOC6hgB5v2Fc/gr6KBut4 q6hDZ9p+08rePM1OSXkYKJvWhs6ueYMLDRMfdMYOFXAor6+XtGP/JpBsGkL6RvwD8Ycw lFAB0R32TpGQt1q6rssaMec47l5Ge/n2g1GoAc1Ldtpgmqd2X/m+eV37ByHsFvHBKixg nYyI2Lax/h/lddQv326+T4zy/Y/ZhLA37BzFXnJlSjT3ampk0KnOFCBVoif0sp/ZX40M CLqg== 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=OD480HfFI1DWGgDlnWsGEABVgZ1gOXgJ9K9FhzWehh8=; b=mUHC04wL+GvAGqRlPYUipnl4WVe/9KhZcUj0CmUGlX+ak6WMLJ4Z8RhfW7hhfHoEkp Pz3OVOCObWpT3QUtyuTZoRLMLFQkPoCxDUYiKRFmehgOBLPqXbwXGajk48hQBsiSz7DV nH30KNaZ4vKy6dih970xkINt2RWS0yS7PkIJBNfGW0CL49RFHvX1oE17axZxBklAIFGj Am8/8yQUiblW8kCPlq3Uf+/3TVGPhlyDYSIpPX7lHPTBnGOJXYhWM99DURJO4Y63kmc1 D2c23ObmPE0NbunzxzQYWqdkTVsREVWkS1ijUkYYsDCZE5MLFoQF2Z0X2IyO9N2IPQJS FmpQ== 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 s2si15818966plr.110.2019.05.06.12.31.30; Mon, 06 May 2019 12:31:48 -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 S1726437AbfEFTac (ORCPT + 99 others); Mon, 6 May 2019 15:30:32 -0400 Received: from www62.your-server.de ([213.133.104.62]:32896 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726302AbfEFTab (ORCPT ); Mon, 6 May 2019 15:30:31 -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 1hNj1F-0002mm-CQ; Mon, 06 May 2019 21:11:21 +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 1hNj1F-000NW8-2z; Mon, 06 May 2019 21:11:21 +0200 Subject: Re: [PATCH v2 1/4] bpf: Add support for reading user pointers To: "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org Cc: 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> From: Daniel Borkmann Message-ID: <3c6b312c-5763-0d9c-7c2c-436ee41f9be1@iogearbox.net> Date: Mon, 6 May 2019 21:11:19 +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: <20190506183116.33014-1-joel@joelfernandes.org> 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 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. This series here should also fix up all current probe read usage under samples/bpf/ and tools/testing/selftests/bpf/. Thanks, Daniel