UPSTREAM: procfs: fixes pthread cross-thread naming if !PR_DUMPABLE
authorJanis Danisevskis <jdanis@google.com>
Thu, 14 Apr 2016 12:57:03 +0000 (13:57 +0100)
committerAmit Pundir <amit.pundir@linaro.org>
Thu, 19 May 2016 07:05:13 +0000 (12:35 +0530)
commit1a6976beade0acd4f56514dac72891cb23bafec3
treeee3e692ebad27ea2acb6437cdefff1bae7ac52e7
parentbe1bb4a76a5a55d354823fa7c6aeae63ac69e245
UPSTREAM: procfs: fixes pthread cross-thread naming if !PR_DUMPABLE

The PR_DUMPABLE flag causes the pid related paths of the
proc file system to be owned by ROOT. The implementation
of pthread_set/getname_np however needs access to
/proc/<pid>/task/<tid>/comm.
If PR_DUMPABLE is false this implementation is locked out.

This patch installs a special permission function for
the file "comm" that grants read and write access to
all threads of the same group regardless of the ownership
of the inode. For all other threads the function falls back
to the generic inode permission check.

Signed-off-by: Janis Danisevskis <jdanis@google.com>
fs/proc/base.c