BPF List
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@meta.com>
To: Kui-Feng Lee <kuifeng@meta.com>,
	bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
	kernel-team@meta.com, song@kernel.org
Cc: Nathan Slingerland <slinger@meta.com>
Subject: Re: [PATCH bpf-next 1/2] bpf: keep a reference to the mm, in case the task is dead.
Date: Fri, 16 Dec 2022 11:09:38 -0800	[thread overview]
Message-ID: <c29f26ac-3b99-4603-295f-ffd80d9223d1@meta.com> (raw)
In-Reply-To: <20221216015912.991616-2-kuifeng@meta.com>



On 12/15/22 5:59 PM, Kui-Feng Lee wrote:
> Fix the system crash that happens when a task iterator travel through
> vma of tasks.
> 
> In task iterators, we used to access mm by following the pointer on
> the task_struct; however, the death of a task will clear the pointer,
> even though we still hold the task_struct.  That can cause an
> unexpected crash for a null pointer when an iterator is visiting a
> task that dies during the visit.  Keeping a reference of mm on the
> iterator ensures we always have a valid pointer to mm.
> 
> Co-developed-by: Song Liu <song@kernel.org>
> Signed-off-by: Song Liu <song@kernel.org>
> Signed-off-by: Kui-Feng Lee <kuifeng@meta.com>
> Reported-by: Nathan Slingerland <slinger@meta.com>

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

  reply	other threads:[~2022-12-16 19:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16  1:59 [PATCH bpf-next 0/2] bpf: fix the crash caused by task iterators over vma Kui-Feng Lee
2022-12-16  1:59 ` [PATCH bpf-next 1/2] bpf: keep a reference to the mm, in case the task is dead Kui-Feng Lee
2022-12-16 19:09   ` Yonghong Song [this message]
2022-12-16  1:59 ` [PATCH bpf-next 2/2] selftests/bpf: create new processes repeatedly in the background Kui-Feng Lee
2022-12-16 20:05   ` Yonghong Song
2022-12-16 21:44     ` Kui-Feng Lee

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=c29f26ac-3b99-4603-295f-ffd80d9223d1@meta.com \
    --to=yhs@meta.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=kernel-team@meta.com \
    --cc=kuifeng@meta.com \
    --cc=slinger@meta.com \
    --cc=song@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox