From: Oleg Nesterov <oleg@redhat.com>
To: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Cc: peterz@infradead.org, mingo@redhat.com, mhocko@suse.com,
keescook@chromium.org, linux-kernel@vger.kernel.org,
mguzik@redhat.com, bsegall@google.com, john.stultz@linaro.org,
ebiederm@xmission.com, gorcunov@openvz.org, matthltc@us.ibm.com,
akpm@linux-foundation.org, luto@amacapital.net, vbabka@suse.cz,
xemul@virtuozzo.com
Subject: Re: [PATCH] prctl: remove one-shot limitation for changing exe link
Date: Tue, 12 Jul 2016 19:01:45 +0200 [thread overview]
Message-ID: <20160712170144.GC4557@redhat.com> (raw)
In-Reply-To: <69b3bfd5-02aa-51ad-12b4-dc8d330b6c67@virtuozzo.com>
On 07/12, Stanislav Kinsburskiy wrote:
>
> 12.07.2016 18:42, Oleg Nesterov пишет:
>> But I would like to ack it in any case. I never understood why do we
>> want/need this MMF_EXE_FILE_CHANGED check, I suggested to remove it
>> many times.
>>
>> And can't resist, please note the xchg() below. Currently (before this
>> patch) we do not need it. I was specially added to ensure that we can
>> just remove this test_and_set_bit(MMF_EXE_FILE_CHANGED) without adding
>> a race.
>
> Thanks, Oleg. I'll take a look.
> But should this be addressed in this patch? Especially if it's not
> needed even now (before this patch)?
Sorry for confusion...
Yes, it is not needed now (before this patch). Because only one caller
of prctl_set_mm_exe_file() can succced and update mm->exe_file. So we
could just do
fput(mm->exe_file);
mm->exe_file = get_file(exe.file);
But after this patch we do need this xchg(), otherwise 2 callers of
prctl_set_mm_exe_file() can race with each other. And this was the
actual reason for xchg: simplify the MMF_EXE_FILE_CHANGED removal in
future.
Oleg.
next prev parent reply other threads:[~2016-07-12 17:01 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-12 15:30 [PATCH] prctl: remove one-shot limitation for changing exe link Stanislav Kinsburskiy
2016-07-12 16:42 ` Oleg Nesterov
2016-07-12 16:52 ` Stanislav Kinsburskiy
2016-07-12 17:01 ` Oleg Nesterov [this message]
2016-07-12 16:48 ` Cyrill Gorcunov
2016-07-12 16:52 ` Eric W. Biederman
2016-07-12 17:29 ` Cyrill Gorcunov
2016-07-12 21:42 ` Cyrill Gorcunov
2016-07-13 10:47 ` Stanislav Kinsburskiy
2016-07-18 20:11 ` One Thousand Gnomes
2016-07-20 11:30 ` Stanislav Kinsburskiy
[not found] ` <8a863273-c571-63d6-c0c3-637dff5645a3@virtuozzo.com>
2016-07-25 18:21 ` Eric W. Biederman
2016-07-25 19:22 ` Cyrill Gorcunov
2016-07-25 19:56 ` Eric W. Biederman
2016-07-26 8:34 ` Cyrill Gorcunov
2016-07-30 17:31 ` Eric W. Biederman
2016-07-30 20:28 ` Mateusz Guzik
2016-07-31 18:45 ` Eric W. Biederman
2016-08-22 15:40 ` Richard Guy Briggs
2016-07-31 22:43 ` Cyrill Gorcunov
2016-07-31 22:49 ` Andy Lutomirski
2016-08-01 9:04 ` Cyrill Gorcunov
2016-08-10 10:48 ` Stanislav Kinsburskiy
2016-07-26 10:21 ` Stanislav Kinsburskiy
-- strict thread matches above, loose matches on Subject: below --
2016-07-12 15:42 Stanislav Kinsburskiy
[not found] <1d254efe-5410-40c4-af4b-9e898682d0b3@email.android.com>
2016-07-13 10:15 ` Oleg Nesterov
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=20160712170144.GC4557@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bsegall@google.com \
--cc=ebiederm@xmission.com \
--cc=gorcunov@openvz.org \
--cc=john.stultz@linaro.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=matthltc@us.ibm.com \
--cc=mguzik@redhat.com \
--cc=mhocko@suse.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=skinsbursky@virtuozzo.com \
--cc=vbabka@suse.cz \
--cc=xemul@virtuozzo.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