[withdrawn] fs-execc-provide-the-correct-process-pid-to-the-pipe-helper.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     fs/exec.c: provide the correct process pid to the pipe helper
has been removed from the -mm tree.  Its filename was
     fs-execc-provide-the-correct-process-pid-to-the-pipe-helper.patch

This patch was dropped because it was withdrawn

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: fs/exec.c: provide the correct process pid to the pipe helper
From: Will Drewry <wad@xxxxxxxxxxxx>

format_corename() uses task_tgid_vnr to provide the numeric pid of a
core-dumping process.  For file-based coredumps, this is perfectly
satisfactory.  However, when the core_pattern contains a pipe, the
substituted PID is invalid in the namespace of the core_pattern pipe
helper, the init namespace.

By changing this, any core collector may now find the process in the init
namespace /proc.  This helps with VFS namespacing too since the mount root
is available via /proc.  Unfortunately, it does not help in cases of more
complex namespacing, like net namespaces.  For that, the helper thread
will need to be migrated to the core-dump namespaces.

I have a separate patch series which implements migrating the
____call_usermodehelper thread to the coredump namespace, but it adds a
fair amount of complexity which might be better handled by someone who
understands that code.  I'm happy to mail it out as well though (it works,
but I don't assign a namespaced pid which may open up issues on its own).

Signed-off-by: Will Drewry <wad@xxxxxxxxxxxx>
Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
Cc: Roland McGrath <roland@xxxxxxxxxx>
Cc: Neil Horman <nhorman@xxxxxxxxxxxxx>
Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/exec.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff -puN fs/exec.c~fs-execc-provide-the-correct-process-pid-to-the-pipe-helper fs/exec.c
--- a/fs/exec.c~fs-execc-provide-the-correct-process-pid-to-the-pipe-helper
+++ a/fs/exec.c
@@ -1601,6 +1601,13 @@ static int format_corename(struct core_n
 	int ispipe = (*pat_ptr == '|');
 	int pid_in_pattern = 0;
 	int err = 0;
+	pid_t pid = task_tgid_vnr(current);
+
+	/* The pipe helper runs in the init namespace and should
+	 * receive the matching pid until that changes.
+	 */
+	if (ispipe)
+		pid = task_tgid_nr(current);
 
 	cn->size = CORENAME_MAX_SIZE * atomic_read(&call_count);
 	cn->corename = kmalloc(cn->size, GFP_KERNEL);
@@ -1628,8 +1635,7 @@ static int format_corename(struct core_n
 			/* pid */
 			case 'p':
 				pid_in_pattern = 1;
-				err = cn_printf(cn, "%d",
-					      task_tgid_vnr(current));
+				err = cn_printf(cn, "%d", pid);
 				break;
 			/* uid */
 			case 'u':
@@ -1691,7 +1697,7 @@ static int format_corename(struct core_n
 	 * and core_uses_pid is set, then .%pid will be appended to
 	 * the filename. Do not do this for piped commands. */
 	if (!ispipe && !pid_in_pattern && core_uses_pid) {
-		err = cn_printf(cn, ".%d", task_tgid_vnr(current));
+		err = cn_printf(cn, ".%d", pid);
 		if (err)
 			return err;
 	}
_

Patches currently in -mm which might be from wad@xxxxxxxxxxxx are


--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux