All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kenny Yu <kennyyu@fb.com>
To: <phoenix1987@gmail.com>
Cc: <ast@kernel.org>, <bpf@vger.kernel.org>, <daniel@iogearbox.net>,
	<yhs@fb.com>, Kenny Yu <kennyyu@fb.com>
Subject: Re: Proposal: bpf_copy_from_user_remote
Date: Thu, 13 Jan 2022 15:37:08 -0800	[thread overview]
Message-ID: <20220113233708.1682225-1-kennyyu@fb.com> (raw)
In-Reply-To: <CAGnuNNtdvbk+wp8uYDPK3weGm5PVmM7hqEaD=Mg2nBT-dKtNHw@mail.gmail.com>

Hi Gabriele,

I just submitted a patch series that adds a similar helper to read
userspace memory from a remote process, please see: https://lore.kernel.org/bpf/20220113233158.1582743-1-kennyyu@fb.com/T/#ma0646f96bccf0b957793054de7404115d321079d

In my patch series, I added a bpf helper to wrap `access_process_vm`
which takes a `struct task_struct` argument instead of a pid.

In your patch series, one issue would be it is not clear which pid namespace
the pid belongs to, whereas passing a `struct task_struct` is unambiguous.
I think the helper signature in my patch series also provides more flexibility,
as the bpf program can also provide different flags on how to read
userspace memory.

Our use case at Meta for this change is to use a bpf task iterator program
to read debug information from a running process in production, e.g.,
extract C++ async stack traces from a running program.

A few questions:
* What is your use case for adding this helper?
* Do you have a specific requirement that requires using a pid, or would a
  helper using `struct task_struct` be sufficient?
* Are you ok with these changes? If so, I will proceed with my patch series.

Thanks,
Kenny Yu

  reply	other threads:[~2022-01-13 23:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 11:03 Proposal: bpf_copy_from_user_remote Gabriele
2022-01-13 23:37 ` Kenny Yu [this message]
2022-01-14 10:00   ` Gabriele
2022-01-14 16:13     ` Gabriele
2022-01-14 22:24       ` Kenny Yu

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=20220113233708.1682225-1-kennyyu@fb.com \
    --to=kennyyu@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=phoenix1987@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.