From: Waiman Long <longman@redhat.com>
To: "Wenjie Li (Evan)" <wenjieli@qti.qualcomm.com>,
"David Wang 王标" <wangbiao3@xiaomi.com>,
"Peter Zijlstra" <peterz@infradead.org>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
"juri.lelli@redhat.com" <juri.lelli@redhat.com>,
"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
"brauner@kernel.org" <brauner@kernel.org>,
"bsegall@google.com" <bsegall@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
陈冠有 <chenguanyou@xiaomi.com>, "Will Deacon" <will@kernel.org>,
"Ting11 Wang 王婷" <wangting11@xiaomi.com>
Subject: Re: 答复: [External Mail]Re: [PATCH 1/1] sched: fix user_mask double free
Date: Thu, 24 Nov 2022 21:08:25 -0500 [thread overview]
Message-ID: <8a48c522-afbc-f18f-5080-4c915f87e2bc@redhat.com> (raw)
In-Reply-To: <DM8PR02MB80559373BC22C4051AE30073ED0F9@DM8PR02MB8055.namprd02.prod.outlook.com>
On 11/24/22 07:04, Wenjie Li (Evan) wrote:
> Hi, Waiman.
>
> "The clearing of user_cpus_ptr is protected by pi_lock. IOW, racing between dup_user_cpus_ptr() and do_set_cpus_allowed is not possible and double free like what you have suggested should not happen." We still can understand why it is impossible to happen. Because we indeed met this issue. Following is we got from ftrace.
>
> 1. Task A pid 27961 run on core6 and is forking/cloning task pid 28051, and task B pid 28051 will copy task struct data from task A pid 27961. So task A p->user_cpus_ptr = ffffff884fbf9200 is equal to task B p->user_cpus_ptr=ffffff884fbf9200 through arch_dup_task_struct.
You are right. I forgot the fact that the value of dst->user_cpus_ptr is
a copy of src. I have posted a v3 patch to address that. Thanks for the
spotting that.
Cheers,
Longman
prev parent reply other threads:[~2022-11-25 2:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 10:04 [PATCH 0/1] " wangbiao3
2022-11-21 10:04 ` [PATCH 1/1] " wangbiao3
2022-11-22 13:18 ` Quentin Perret
2022-11-22 14:05 ` Peter Zijlstra
2022-11-22 14:06 ` Peter Zijlstra
2022-11-22 15:39 ` Waiman Long
2022-11-22 18:13 ` Waiman Long
[not found] ` <1fe9abbdd12b41fc87c92b60550fc909@xiaomi.com>
[not found] ` <9a6b10cd-855d-ca15-01e9-2c95a8b692be@redhat.com>
[not found] ` <9cc51697705f472e99a620eee8569a32@xiaomi.com>
2022-11-24 3:59 ` 答复: [External Mail]Re: " Waiman Long
2022-11-24 12:04 ` Wenjie Li (Evan)
2022-11-25 2:08 ` Waiman Long [this message]
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=8a48c522-afbc-f18f-5080-4c915f87e2bc@redhat.com \
--to=longman@redhat.com \
--cc=brauner@kernel.org \
--cc=bsegall@google.com \
--cc=chenguanyou@xiaomi.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=vincent.guittot@linaro.org \
--cc=wangbiao3@xiaomi.com \
--cc=wangting11@xiaomi.com \
--cc=wenjieli@qti.qualcomm.com \
--cc=will@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
all inboxes | Powered by JetHome®