bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Yonghong Song <yhs@fb.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Christoph Hellwig <hch@infradead.org>,
	Alan Maguire <alan.maguire@oracle.com>,
	Yixun Lan <dlan@gentoo.org>, Palmer Dabbelt <palmer@dabbelt.com>,
	linux-riscv@lists.infradead.org,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH] RISC-V/bpf: Enable bpf_probe_read{, str}()
Date: Wed, 6 Jul 2022 00:01:51 -0700	[thread overview]
Message-ID: <YsUzX2IeNb/u9VmN@infradead.org> (raw)
In-Reply-To: <712c8fac-6784-2acd-66ca-d1fd393aef23@fb.com>

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 <hch@infradead.org> 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.

  reply	other threads:[~2022-07-06  7:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-03 13:09 [PATCH] RISC-V/bpf: Enable bpf_probe_read{, str}() Yixun Lan
2022-07-03 13:12 ` Conor Dooley
2022-07-04  2:20   ` Yixun Lan
2022-07-04  6:29     ` Conor.Dooley
2022-07-04  5:53 ` Christoph Hellwig
2022-07-06  5:00   ` Andrii Nakryiko
2022-07-06  6:41     ` Yonghong Song
2022-07-06  7:01       ` Christoph Hellwig [this message]
2022-07-09  1:01         ` Yixun Lan
2022-07-09  6:24           ` Christoph Hellwig
2022-07-09  8:48             ` Yixun Lan
2022-07-11  3:58               ` Christoph Hellwig
2022-07-06  7:00     ` Christoph Hellwig
2022-07-08 22:22       ` Andrii Nakryiko
2022-07-09  6:25         ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YsUzX2IeNb/u9VmN@infradead.org \
    --to=hch@infradead.org \
    --cc=alan.maguire@oracle.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dlan@gentoo.org \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).