From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E482C43334 for ; Wed, 6 Jul 2022 07:02:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231210AbiGFHCD (ORCPT ); Wed, 6 Jul 2022 03:02:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbiGFHCA (ORCPT ); Wed, 6 Jul 2022 03:02:00 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D324D1F2C2; Wed, 6 Jul 2022 00:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/1B8eXbzsym5vD7WEQKQVJKQdxQ5KaDuSszuUOxu30E=; b=JgY9CaH1XkdAyfaKVa3yL6lLfO mnczioUxVHk8S1zjflPUMY/wMV3QKFfGH932P1TfDHvdnzQhwU0TRhaxIUak8DEdZxNbywyw3A1zJ 0/COwpX7kwcB4Xfl5AOfCDfM8aI04sIYA0YpChI8HHpypd7Kfgsz+++mqdIK+rF2Ewrlq+JoArbFO yDk+vyJcsverWoWn7oQRIF59fM6/wbhSIfe8p20psQwrxD4RPCMwZ0JA8Tz0yPC5f6qBLIo7BWLSl ZVr55GCwpcULf02yMZPrsQNColwrTmnb9HnXf9zMQ+RW0WhWG20Uaw1QwY+nSYGZtPAVuoQCN0wyy CA+mmU9A==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8z2l-006uK0-Ir; Wed, 06 Jul 2022 07:01:51 +0000 Date: Wed, 6 Jul 2022 00:01:51 -0700 From: Christoph Hellwig To: Yonghong Song Cc: Andrii Nakryiko , Christoph Hellwig , Alan Maguire , Yixun Lan , Palmer Dabbelt , linux-riscv@lists.infradead.org, Paul Walmsley , Albert Ou , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , John Fastabend , KP Singh , open list , Networking , bpf Subject: Re: [PATCH] RISC-V/bpf: Enable bpf_probe_read{, str}() Message-ID: References: <20220703130924.57240-1-dlan@gentoo.org> <712c8fac-6784-2acd-66ca-d1fd393aef23@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <712c8fac-6784-2acd-66ca-d1fd393aef23@fb.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 05, 2022 at 11:41:30PM -0700, Yonghong Song wrote: > > > On 7/5/22 10:00 PM, Andrii Nakryiko wrote: > > On Sun, Jul 3, 2022 at 10:53 PM Christoph Hellwig wrote: > > > > > > On Sun, Jul 03, 2022 at 09:09:24PM +0800, Yixun Lan wrote: > > > > Enable this option to fix a bcc error in RISC-V platform > > > > > > > > And, the error shows as follows: > > > > > > These should not be enabled on new platforms. Use the proper helpers > > > to probe kernel vs user pointers instead. > > > > riscv existed as of [0], so I'd argue it is a proper bug fix, as > > corresponding select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE should > > have been added back then. > > > > But I also agree that BCC tools should be updated to use proper > > bpf_probe_read_{kernel,user}[_str()] helpers, please contribute such > > fixes to BCC tools and BCC itself as well. Cc'ed Alan as his ksnoop in > > libbpf-tools seems to be using bpf_probe_read() as well and needs to > > be fixed. > > Yixun, the bcc change looks like below: No, this is broken. bcc needs to stop using bpf_probe_read entirely for user addresses and unconditionally use bpf_probe_read_user first and only fall back to bpf_probe_read if not supported.