All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cedric Le Goater <clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
To: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: Re: [PATCH] namespaces: introduce sys_hijack (v4)
Date: Fri, 12 Oct 2007 11:30:33 +0200	[thread overview]
Message-ID: <470F3EB9.3030001@fr.ibm.com> (raw)
In-Reply-To: <20071011221534.GA28604-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>

Serge E. Hallyn wrote:
> Quoting Serge E. Hallyn (serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org):
>> >From 945fe66259cd0cfdc2fe846287b7821e329a558c Mon Sep 17 00:00:00 2001
>> From: sergeh-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org <hallyn@kernel.(none)>
>> Date: Tue, 9 Oct 2007 08:30:30 -0700
>> Subject: [PATCH] namespaces: introduce sys_hijack (v4)
>>
>> Move most of do_fork() into a new do_fork_task() which acts on
>> a new argument, task, rather than on current.  do_fork() becomes
>> a call to do_fork_task(current, ...).
>>
>> Introduce sys_hijack (for x86 only so far).  It is like clone, but
>>  in place of a stack pointer (which is assumed null) it accepts a
>> pid.  The process identified by that pid is the one which is
>> actually cloned.  Some state - include the file table, the signals
>> and sighand (and hence tty), and the ->parent are taken from the
>> calling process.
>>
>> The effect is a sort of namespace enter.  The following program
>> uses sys_hijack to 'enter' all namespaces of the specified pid.
>> For instance in one terminal, do
>>
>> 	mount -t cgroup -ons /cgroup
>> 	hostname
>> 	  qemu
>> 	ns_exec -u /bin/sh
>> 	  hostname serge
>>           echo $$
>>             1073
>> 	  cat /proc/$$/cgroup
>> 	    ns:/node_1073
>>
>> In another terminal then do
>>
>> 	hostname
>> 	  qemu
>> 	cat /proc/$$/cgroup
>> 	  ns:/
>> 	hijack 1073
>> 	  hostname
>> 	    serge
>> 	  cat /proc/$$/cgroup
>> 	    ns:/node_1073
>>
>> sys_hijack is arch-dependent and is only implemented for i386 so far.
>>
>> Changelog:
>> 	Aug 23: send a stop signal to the hijacked process
>> 		(like ptrace does).
>> 	Oct 09: Update for 2.6.23-rc8-mm2 (mainly pidns)
>> 		Don't take task_lock under rcu_read_lock
>> 		Send hijacked process to cgroup_fork() as
>> 		the first argument.
>> 		Removed some unneeded task_locks.
> 
> Thanks to Cedric for finding an oops when using pid namespaces.  The
> following patch fixes the problem.

it works fine now.

Thanks !

C.

  parent reply	other threads:[~2007-10-12  9:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-09 20:09 [PATCH] namespaces: introduce sys_hijack (v4) Serge E. Hallyn
     [not found] ` <20071009200928.GA21846-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2007-10-10 17:06   ` Cedric Le Goater
     [not found]     ` <470D068F.8050405-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-10 18:32       ` Serge E. Hallyn
     [not found]         ` <20071010183234.GA24770-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2007-10-16  8:51           ` Cedric Le Goater
     [not found]             ` <47147B78.2060206-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-16 14:31               ` Serge E. Hallyn
2007-10-11 22:15   ` Serge E. Hallyn
     [not found]     ` <20071011221534.GA28604-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2007-10-12  9:30       ` Cedric Le Goater [this message]
2007-10-16  9:09   ` [Devel] " Paul Menage
     [not found]     ` <6599ad830710160209w64765f2ao6a1f811b4ea50708-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-10-16 14:37       ` Serge E. Hallyn
     [not found]         ` <20071016143744.GC30799-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2007-10-16 16:32           ` Paul Menage
     [not found]             ` <6599ad830710160932t3769bc29w8a6461274226633d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-10-16 18:57               ` Serge E. Hallyn
     [not found]                 ` <20071016185737.GA4115-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2007-10-16 19:03                   ` Paul Menage
     [not found]                     ` <6599ad830710161203h50198ae5o73bfacad32dd8bb6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-10-16 19:12                       ` Serge E. Hallyn
     [not found]                         ` <20071016191200.GB4115-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2007-10-16 19:29                           ` Paul Menage
2007-10-16 19:32                           ` Paul Menage
2007-10-16 21:28                           ` Cedric Le Goater
     [not found]                             ` <47152CF6.7000605-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2007-10-16 21:32                               ` Serge E. Hallyn

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=470F3EB9.3030001@fr.ibm.com \
    --to=clg-nmtc/0zbporqt0dzr+alfa@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.