From: Aleksa Sarai <asarai@suse.de>
To: Oleg Nesterov <oleg@redhat.com>
Cc: viro@zeniv.linux.org.uk, ebiederm@xmission.com,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
cyphar@cyphar.com, dev@opencontainers.org
Subject: Re: [PATCH] fs: exec: apply CLOEXEC before changing dumpable task flags
Date: Wed, 21 Dec 2016 16:04:04 +1100 [thread overview]
Message-ID: <622e4440-a328-2785-fb77-9a77c5b000df@suse.de> (raw)
In-Reply-To: <20161220172955.GA7776@redhat.com>
>> @@ -1287,6 +1287,13 @@ void setup_new_exec(struct linux_binprm * bprm)
>> /* This is the point of no return */
>> current->sas_ss_sp = current->sas_ss_size = 0;
>>
>> + /*
>> + * We have to apply CLOEXEC before we change whether the process is
>> + * dumpable to avoid a race with a process in userspace trying to access
>> + * the should-be-closed file descriptors of a process undergoing exec(2).
>> + */
>> + do_close_on_exec(current->files);
>
> Cosmetic, but perhaps this should go into flush_old_exec() then?
Yeah, I was thinking the same thing. Also, I'll cc stable (v3.2+) to the
patch.
--
Aleksa Sarai
Software Engineer (Containers)
SUSE Linux GmbH
https://www.cyphar.com/
prev parent reply other threads:[~2016-12-21 5:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-20 11:04 [PATCH] fs: exec: apply CLOEXEC before changing dumpable task flags Aleksa Sarai
2016-12-20 17:29 ` Oleg Nesterov
2016-12-21 5:04 ` Aleksa Sarai [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=622e4440-a328-2785-fb77-9a77c5b000df@suse.de \
--to=asarai@suse.de \
--cc=cyphar@cyphar.com \
--cc=dev@opencontainers.org \
--cc=ebiederm@xmission.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).