Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2153192imw; Wed, 6 Jul 2022 00:37:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vxbY2aESF72UoZ6VlohZxtseMsnyNvbrhideG2qm0UviP9R42vKKk9p4Csj/6MyIagAoTB X-Received: by 2002:a05:6a00:f0e:b0:528:1b63:c9be with SMTP id cr14-20020a056a000f0e00b005281b63c9bemr31789114pfb.61.1657093053011; Wed, 06 Jul 2022 00:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657093053; cv=none; d=google.com; s=arc-20160816; b=x8VMbXLtMbNvWaTdi5bR8DbtpzqlR0KfUV6rqyLt039Vr055GCCstVIB9enWsVmPlN cguKezzUzlMswMqPzzrNG0gNkGwP0dujtDihi41Jl9WI/FhDfBl66jIgBYsRA56shzH4 B/vuz5IcCLS0XVMBTTlqXL4lknxsbjRDXqxiCKh+GYR8Wg7aLeK35ILuS8UTcUydWYFD cdnw33D8xcugSTWu8pzd4mMnC7v/Y1ujpjUI5O0YbKHa2ZbVIvqztyH9o27qAB4Ohjzt mlntY5PUJ0tT1ImneD3tP0JI7QdmiGqz1v7gQlgFEHmnryXaCBFgcE6Ej5HnUwZkjwf8 Dp1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/1B8eXbzsym5vD7WEQKQVJKQdxQ5KaDuSszuUOxu30E=; b=fY7kwR978RaZ+E+FmPAYDwnzdsP4MjeyHyxK/VQ8C3jDeL1nrumBJZ73xfVF7bOwu7 Ybei2SwnfY2MGZBnKDty8AwM85YTeoj9B6m5xz6TJnEeqnOvD8jFbyRC39OZyTrke1jU kkwV6P4412SVKjuRqgT8WxqFQu0P2PEKSCRh3U+ZxsNSbNIXUN/rT3PF64p33+TsGK1c 00B2tTGcjs1zq3qGlxMBXwo6IGJOKc68kqZwPvhPwdP/xfc9vc8QS/R4BFhpTcjS79Pl xTvY2+wuMg92aQcfw+c83Iw2Xyv0Pv/k2LSn4VJkscVVOaFJTgQ1KSVI3JLlXst9M7vR B03g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=JgY9CaH1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k71-20020a63844a000000b0041294aa04a7si2025492pgd.857.2022.07.06.00.37.06; Wed, 06 Jul 2022 00:37:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=JgY9CaH1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231194AbiGFHCC (ORCPT + 99 others); Wed, 6 Jul 2022 03:02:02 -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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.