BPF List
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@meta.com>
To: Hou Tao <houtao@huaweicloud.com>,
	bpf@vger.kernel.org, Martin KaFai Lau <martin.lau@linux.dev>,
	Hao Luo <haoluo@google.com>, Yonghong Song <yhs@fb.com>
Cc: Andrii Nakryiko <andrii@kernel.org>, Song Liu <song@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@google.com>, Jiri Olsa <jolsa@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	houtao1@huawei.com
Subject: Re: [PATCH bpf-next v3 1/3] bpf: Pin the start cgroup in cgroup_iter_seq_init()
Date: Mon, 21 Nov 2022 08:27:09 -0800	[thread overview]
Message-ID: <29a89827-0922-7520-6540-edc0c07f7fd9@meta.com> (raw)
In-Reply-To: <20221121073440.1828292-2-houtao@huaweicloud.com>



On 11/20/22 11:34 PM, Hou Tao wrote:
> From: Hou Tao <houtao1@huawei.com>
> 
> bpf_iter_attach_cgroup() has already acquired an extra reference for the
> start cgroup, but the reference may be released if the iterator link fd
> is closed after the creation of iterator fd, and it may lead to
> user-after-free problem when reading the iterator fd.
> 
> An alternative fix is pinning iterator link when opening iterator,
> but it will make iterator link being still visible after the close of
> iterator link fd and the behavior is different with other link types, so
> just fixing it by acquiring another reference for the start cgroup.
> 
> Fixes: d4ccaf58a847 ("bpf: Introduce cgroup iter")
> Signed-off-by: Hou Tao <houtao1@huawei.com>

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

  reply	other threads:[~2022-11-21 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21  7:34 [PATCH bpf-next v3 0/3] bpf: Pin the start cgroup for cgroup iterator Hou Tao
2022-11-21  7:34 ` [PATCH bpf-next v3 1/3] bpf: Pin the start cgroup in cgroup_iter_seq_init() Hou Tao
2022-11-21 16:27   ` Yonghong Song [this message]
2022-11-21  7:34 ` [PATCH bpf-next v3 2/3] selftests/bpf: Add cgroup helper remove_cgroup() Hou Tao
2022-11-21  7:34 ` [PATCH bpf-next v3 3/3] selftests/bpf: Add test for cgroup iterator on a dead cgroup Hou Tao
2022-11-21 16:50 ` [PATCH bpf-next v3 0/3] bpf: Pin the start cgroup for cgroup iterator patchwork-bot+netdevbpf

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=29a89827-0922-7520-6540-edc0c07f7fd9@meta.com \
    --to=yhs@meta.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=houtao1@huawei.com \
    --cc=houtao@huaweicloud.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --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