proc: disable mem_write after exec
commit6c10270e006f99df18744d7e5257e9c00d03170e
authoredrikk <edriss@hotmail.com>
Thu, 14 May 2015 15:41:15 +0000 (14 15:41 +0000)
committerToastman <toastman@galactic_core>
Thu, 17 Sep 2015 17:02:04 +0000 (18 00:02 +0700)
treed16c360cb7112eaa8381fc5ac52a8285254b728d
parentf91615de087d2dd16b90cccbf5181c1d2e400e63
proc: disable mem_write after exec

Cherry Picking:  http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=26947f8c8f9598209001cdcd31bb2162a2e54691

This change makes mem_write() observe the same constraints as mem_read().  This
is particularly important for mem_write as an accidental leak of the fd across
an exec could result in arbitrary modification of the target process' memory.
IOW, /proc/pid/mem is implicitly close-on-exec.
release/src-rt-6.x.4708/linux/linux-2.6.36/fs/proc/base.c