All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: John Fastabend <john.fastabend@gmail.com>,
	Hengqi Chen <hengqi.chen@gmail.com>, <bpf@vger.kernel.org>
Cc: <andriin@fb.com>, <jolsa@kernel.org>
Subject: Re: [PATCH bpf-next] bpf: Expose bpf_d_path helper to vfs_read/vfs_write
Date: Wed, 14 Jul 2021 17:18:54 -0700	[thread overview]
Message-ID: <6f42985e-063e-205b-820e-6bad600caf54@fb.com> (raw)
In-Reply-To: <60ec94013acd1_50e1d2081@john-XPS-13-9370.notmuch>



On 7/12/21 12:12 PM, John Fastabend wrote:
> Hengqi Chen wrote:
>> Add vfs_read and vfs_write to bpf_d_path allowlist.
>> This will help tools like IOVisor's filetop to get
>> full file path.
>>
>> Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
>> ---
> 
> As I understand it dpath helper is allowed as long as we
> are not in NMI/interrupt context, so these should be fine
> to add.
> 
> Acked-by: John Fastabend <john.fastabend@gmail.com>

The corresponding bcc discussion thread is here:
   https://github.com/iovisor/bcc/issues/3527

Acked-by: Yonghong Song <yhs@fb.com>

> 
>>   kernel/trace/bpf_trace.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
>> index 64bd2d84367f..6d3f951f38c5 100644
>> --- a/kernel/trace/bpf_trace.c
>> +++ b/kernel/trace/bpf_trace.c
>> @@ -861,6 +861,8 @@ BTF_ID(func, vfs_fallocate)
>>   BTF_ID(func, dentry_open)
>>   BTF_ID(func, vfs_getattr)
>>   BTF_ID(func, filp_close)
>> +BTF_ID(func, vfs_read)
>> +BTF_ID(func, vfs_write)
>>   BTF_SET_END(btf_allowlist_d_path)
>>   
>>   static bool bpf_d_path_allowed(const struct bpf_prog *prog)
>> -- 
>> 2.25.1
>>
> 
> 

  reply	other threads:[~2021-07-15  0:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 16:24 [PATCH bpf-next] bpf: Expose bpf_d_path helper to vfs_read/vfs_write Hengqi Chen
2021-07-12 19:12 ` John Fastabend
2021-07-15  0:18   ` Yonghong Song [this message]
2021-07-16  1:44     ` Alexei Starovoitov
2021-07-17 16:43       ` Yonghong Song
2021-07-18 11:17         ` Hengqi Chen

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=6f42985e-063e-205b-820e-6bad600caf54@fb.com \
    --to=yhs@fb.com \
    --cc=andriin@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=hengqi.chen@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    /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.