Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3004228yba; Mon, 6 May 2019 15:25:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwoY2iZy6gn7I6ao1A3O6kspJGUsuk40afyhBzsOrSatagqvVkJbB8ABUO0l5EpdVla2Kwm X-Received: by 2002:a63:ed4f:: with SMTP id m15mr35905832pgk.387.1557181532377; Mon, 06 May 2019 15:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557181532; cv=none; d=google.com; s=arc-20160816; b=hOH6JGEmy4/j0JuHCnnhBIPu4nVGawBs4OEhCUT2mOWO4Gm1IMlh0inYNoybeCSgkZ 3bCO42jooEr/tB7IBLklJXu7qpG6ygd7S1S01m9xtNFPvyNcomF5u5xwvuSnHUMGQ19t jEW6L5UOig/WbC+XINzfQ2CDd6DBeECsv8zRIs0dTunDY0eQ2jzj1hxchAwhM8vWI4ke qPXkgTioHbK36gQudKF9MtwJ7Yd5VabEv1cy2FZrgaqgpzd1BjttQGEi0geOnkUFkZxz 65cwI0Oshwf0jeTPU08PoHD5Wk/J/np30pswpR/jwujDgABq0kF6Ne49qpevAgiXd9IK f7nQ== 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; bh=X6AsW9Jrie3IsZSe2TZsbvmbp5YPn8gUTJQ2fTK9hoY=; b=FlPf9ZDMIMCzz3MZ2L3olhuL0NrgQmorEYtU3zIDQVPu5mui3TQ6vUNKyzswBYBTJb u8PC9sXnoTCD1Y389dt+A+spgLhFh9tK4mQ8+PQiu9f6DqPDi6BwN9i7WKGynnGUsLjv ChCUwzT/m7RI8WF+x+/WpP2x3vWb7lQK/R9XsFyW39ixnIQ+rTiGcfmfOJ7P+0ro6NT2 QeYjhyl0oECjvuDfOWRRXbBsnlkxvpcvqmAYQ8PVFtnL2+/xA4ur1Uv7UuDXuVcDkr19 HTAWLJVpsrIQW0fLDJqsgUE22ehPh+MTDTR63HFmHw45xPY2pHylj+MgBXnMXxC6CEIX Bjfg== 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 l71si16295057pfb.250.2019.05.06.15.25.16; Mon, 06 May 2019 15:25:32 -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 S1726418AbfEFWY1 (ORCPT + 99 others); Mon, 6 May 2019 18:24:27 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34658 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbfEFWY1 (ORCPT ); Mon, 6 May 2019 18:24:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 578BC80D; Mon, 6 May 2019 15:24:26 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.194.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5B28E3F575; Mon, 6 May 2019 15:24:22 -0700 (PDT) Date: Mon, 6 May 2019 23:24:19 +0100 From: Qais Yousef To: "Joel Fernandes (Google)" Cc: linux-kernel@vger.kernel.org, Michal Gregorczyk , Adrian Ratiu , Mohammad Husain , 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, Daniel Borkmann , Ingo Molnar , Martin KaFai Lau , netdev@vger.kernel.org, Song Liu Subject: Re: [PATCH v2 1/4] bpf: Add support for reading user pointers Message-ID: <20190506222419.mmysckxrkewkfl3t@e107158-lin.cambridge.arm.com> References: <20190506183116.33014-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190506183116.33014-1-joel@joelfernandes.org> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/06/19 14:31, 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. You haven't updated the commit message as agreed. Please add more explanation on how arm64 fails or drop the reference. Anyone reads this as-is would think it always fails on arm64 but it does under some circumstances which should be explained properly. I tried opensnoop on 5.1-rc7 and 4.9.173 stable on juno-r2 using the in-tree defconfig and opensnoop returned the correct results on both cases. Thanks -- Qais Yousef