[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzYEWxb+cm-cyBFMtA4mBfRfhp9dypfV+7K=wR01XYudzg@mail.gmail.com>
Date: Mon, 1 Nov 2021 16:47:42 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Yafang Shao <laoar.shao@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>,
Petr Mladek <pmladek@...e.com>,
Peter Ziljstra <peterz@...radead.org>,
Al Viro <viro@...iv.linux.org.uk>,
Valentin Schneider <valentin.schneider@....com>,
Qiang Zhang <qiang.zhang@...driver.com>,
robdclark <robdclark@...omium.org>,
Christian Brauner <christian@...uner.io>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>, Martin Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
john fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>,
dennis.dalessandro@...nelisnetworks.com,
mike.marciniszyn@...nelisnetworks.com,
Doug Ledford <dledford@...hat.com>,
Jason Gunthorpe <jgg@...pe.ca>, linux-rdma@...r.kernel.org,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
"linux-perf-use." <linux-perf-users@...r.kernel.org>,
linux-fsdevel@...r.kernel.org,
Linux Memory Management List <linux-mm@...ck.org>,
open list <linux-kernel@...r.kernel.org>,
kernel test robot <oliver.sang@...el.com>,
kbuild test robot <lkp@...el.com>,
Alexei Starovoitov <alexei.starovoitov@...il.com>
Subject: Re: [PATCH v7 07/11] tools/bpf/bpftool/skeleton: make it adopt to
task comm size change
On Sun, Oct 31, 2021 at 11:04 PM Yafang Shao <laoar.shao@...il.com> wrote:
>
> bpf_probe_read_kernel_str() will add a nul terminator to the dst, then
> we don't care about if the dst size is big enough.
>
> Signed-off-by: Yafang Shao <laoar.shao@...il.com>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
> Cc: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
> Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>
> Cc: Andrii Nakryiko <andrii.nakryiko@...il.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Cc: Al Viro <viro@...iv.linux.org.uk>
> Cc: Kees Cook <keescook@...omium.org>
> Cc: Petr Mladek <pmladek@...e.com>
> ---
LGTM.
Acked-by: Andrii Nakryiko <andrii@...nel.org>
> tools/bpf/bpftool/skeleton/pid_iter.bpf.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/bpf/bpftool/skeleton/pid_iter.bpf.c b/tools/bpf/bpftool/skeleton/pid_iter.bpf.c
> index d9b420972934..f70702fcb224 100644
> --- a/tools/bpf/bpftool/skeleton/pid_iter.bpf.c
> +++ b/tools/bpf/bpftool/skeleton/pid_iter.bpf.c
> @@ -71,8 +71,8 @@ int iter(struct bpf_iter__task_file *ctx)
>
> e.pid = task->tgid;
> e.id = get_obj_id(file->private_data, obj_type);
> - bpf_probe_read_kernel(&e.comm, sizeof(e.comm),
> - task->group_leader->comm);
> + bpf_probe_read_kernel_str(&e.comm, sizeof(e.comm),
> + task->group_leader->comm);
> bpf_seq_write(ctx->meta->seq, &e, sizeof(e));
>
> return 0;
> --
> 2.17.1
>
Powered by blists - more mailing lists