Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1545319

Re: [PATCH] fs: exec: apply CLOEXEC before changing dumpable task flags

From Oleg Nesterov <oleg@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] fs: exec: apply CLOEXEC before changing dumpable task flags
Date 2016-12-20 18:40 +0100
Message-ID <sQwym-89-29@gated-at.bofh.it> (permalink)
References <sQqsW-4MR-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 12/20, Aleksa Sarai wrote:
>
> @@ -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?

But I am fine either way, up to you.

Oleg.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] fs: exec: apply CLOEXEC before changing dumpable task flags Aleksa Sarai <asarai@suse.de> - 2016-12-20 12:10 +0100
  Re: [PATCH] fs: exec: apply CLOEXEC before changing dumpable task         flags Oleg Nesterov <oleg@redhat.com> - 2016-12-20 18:40 +0100
    Re: [PATCH] fs: exec: apply CLOEXEC before changing dumpable task  flags Aleksa Sarai <asarai@suse.de> - 2016-12-21 06:10 +0100

csiph-web