[Devel] [PATCH 06/30] netns: don't get/put old netns on CLONE_NEWNET

2009-04-09 Thread Alexey Dobriyan
copy_net_ns() doesn't copy anything, it creates fresh netns, so get/put of old netns is unneeded. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- net/core/net_namespace.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) --- a/net/core/net_namespace.c +++ b/net/core

[Devel] [PATCH 05/30] nsproxy: add create_nsproxy()

2009-04-09 Thread Alexey Dobriyan
clone_nsproxy() does useless copying of old nsproxy -- every pointer will be rewritten to new ns or to old ns. Remove copying, rename clone_nsproxy(), it will be used by C/R code to create fresh nsproxy on restart. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- kernel/nsproxy.c | 19

[Devel] [PATCH 03/30] ipcns: remove useless get/put while CLONE_NEWIPC

2009-04-09 Thread Alexey Dobriyan
copy_ipcs() doesn't actually copy anything. If new ipcns is created, it's created from scratch, in this case get/put on old ipcns isn't needed. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- ipc/namespace.c |6 +- 1 file changed, 1 insertion(+), 5 deletions(-) --- a/ipc

[Devel] [PATCH 07/30] netns: extract net_create()

2009-04-09 Thread Alexey Dobriyan
net_create() will be used by C/R code to create fresh netns on restart. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/net/net_namespace.h |1 + net/core/net_namespace.c| 44 2 files changed, 21 insertions(+), 24 deletions

[Devel] [PATCH 08/30] i386: ifdef out struct thread_struct::fs

2009-04-09 Thread Alexey Dobriyan
it after the patch. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86/include/asm/processor.h |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -422,7 +422,9 @@ struct thread_struct

[Devel] [PATCH 30/30] cr: ipc_ns

2009-04-09 Thread Alexey Dobriyan
Create/restore ipc_ns as an object, restore sysctl values. FIXME: restoration of sysctls is buggy as-is, values should be written at the very last moment FIXME: actual restoration of IPC objects. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h | 14

[Devel] [PATCH 29/30] cr: tty/pty

2009-04-09 Thread Alexey Dobriyan
FIXME: opened tty won't passed -checkpoint check. currently in desperate need on how to test it. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h | 37 kernel/cr/Kconfig |1 kernel/cr/Makefile |1 kernel/cr/cpt-sys.c |6 + kernel/cr/cr

[Devel] Re: [PATCH 00/30] C/R OpenVZ/Virtuozzo style

2009-04-09 Thread Alexey Dobriyan
On Fri, Apr 10, 2009 at 06:32:07AM +0400, Alexey Dobriyan wrote: This is to show how we see C/R and to provoke discussion on number of important issues (mounts, ...). This is small part of long-awaited to be cleanuped code. It's able to restore busyloop on i386 and x86_64 and restore i386

[Devel] [PATCH 22/30] cr: deal with opened files

2009-04-09 Thread Alexey Dobriyan
C/R tsk-files and opened files! fd should have struct file::checkpoint ;-) Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h | 16 +++ kernel/cr/cpt-sys.c |6 + kernel/cr/cr-file.c | 249 kernel/cr/cr-task.c

[Devel] [PATCH 19/30] cr: deal with nsproxy

2009-04-09 Thread Alexey Dobriyan
To save nsproxy, or to not save nsproxy? Don't think much, save it. I argue that nsproxy should be removed totally, if someone thinks otherwise. ;-) The idea is that relations between in-kernel data structures close map relations in dumpfile. Signed-off-by: Alexey Dobriyan adobri...@gmail.com

[Devel] [PATCH 20/30] cr: deal with UTS stuff (struct uts_namespace)

2009-04-09 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h | 14 + kernel/cr/Kconfig |1 kernel/cr/Makefile |1 kernel/cr/cpt-sys.c|6 ++ kernel/cr/cr-nsproxy.c | 21 +++- kernel/cr/cr-uts.c | 123

[Devel] [PATCH 15/30] cr: x86_64 xstate support

2009-04-09 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h|3 ++ kernel/cr/cr-x86_64.c | 72 -- 2 files changed, 67 insertions(+), 8 deletions(-) --- a/include/linux/cr.h +++ b/include/linux/cr.h @@ -140,6 +140,9 @@ struct

[Devel] [PATCH 21/30] cr: deal with pid/pidns

2009-04-09 Thread Alexey Dobriyan
C/R struct pid and struct pid_namespace. Userspace should see same pids as before. -last_pid is visible though /proc/loadavg, so it needs to be dumped too, sigh. FIXME: restoration of pidns is recursive. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h

[Devel] [PATCH 25/30] cr: deal with credentials

2009-04-09 Thread Alexey Dobriyan
Dump/restore struct cred, struct user, struct user_namespace, struct group_info FIXME: restore struct user FIXME: restore struct file::f_cred Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h | 46 include/linux/cred.h |1 kernel/cr/Kconfig|1

[Devel] [PATCH 16/30] cr: x86_64 LDT support

2009-04-09 Thread Alexey Dobriyan
FIXME: actual LDT restore Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- kernel/cr/cr-x86_64.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) --- a/kernel/cr/cr-x86_64.c +++ b/kernel/cr/cr-x86_64.c @@ -1,6 +1,7 @@ /* Copyright (C) 2000-2009 Parallels

[Devel] [PATCH 17/30] cr: extend arch_setup_additional_pages()

2009-04-09 Thread Alexey Dobriyan
Add start argument, it will be used to map vDSO to exactly same place on restart(2). Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/powerpc/include/asm/elf.h |1 + arch/powerpc/kernel/vdso.c |2 +- arch/s390/include/asm/elf.h|2 +- arch/s390/kernel

[Devel] [PATCH 11/30] cr: i386 support

2009-04-09 Thread Alexey Dobriyan
Segment registers abstraction is done to allow i386 = x86_64 COMPAT=y migration. What is unsupported is in cr_arch_check_task_struct(). FIXME: support more that busyloop. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86/include/asm/unistd_32.h |2 arch/x86/kernel

[Devel] [PATCH 24/30] cr: deal with signals

2009-04-09 Thread Alexey Dobriyan
Dump signal_struct, sighand_struct. FIXME: correstly restore, check everything Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h | 28 include/linux/signal.h |1 kernel/cr/Makefile |1 kernel/cr/cpt-sys.c| 12 + kernel/cr/cr-signal.c

[Devel] [PATCH 27/30] cr: deal with netns

2009-04-09 Thread Alexey Dobriyan
netns is full of questions too. Restore netns itself, and core.somaxconn, unix.max_dgram_qlen for start. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h | 13 + kernel/cr/Kconfig |1 kernel/cr/Makefile |1 kernel/cr/cpt-sys.c|6

[Devel] [PATCH 26/30] cr: mount namespace

2009-04-09 Thread Alexey Dobriyan
This is one big FIXME: What to do with overmounted files? What to do with mounts at all, who should restore them? just restore something to not oops on task exit Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- fs/namespace.c| 22 ++-- include/linux

[Devel] [PATCH 13/30] cr: i386 LDT support

2009-04-09 Thread Alexey Dobriyan
FIXME: LDT actual restoration Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- kernel/cr/cr-x86_32.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) --- a/kernel/cr/cr-x86_32.c +++ b/kernel/cr/cr-x86_32.c @@ -1,6 +1,7 @@ /* Copyright (C) 2000-2009

[Devel] [PATCH 09/30] x86_64: ifdef out struct thread_struct::ip

2009-04-09 Thread Alexey Dobriyan
struct thread_struct::ip isn't used on x86_64, struct pt_regs::ip is used instead. kgdb should be reading 0, but I can't check it. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86/include/asm/processor.h |2 ++ arch/x86/kernel/kgdb.c |2 +- 2 files changed, 3

[Devel] [PATCH 23/30] cr: deal with fs_struct

2009-04-09 Thread Alexey Dobriyan
Dump umask, root, pwd. root, pwd are dumped as names returned by d_path. FIXME, FIXME, FIXME: think through what to do with overmount and vfsmount themselves!!! FIXME: restore root, pwd, tsk-fs itself Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h | 12

[Devel] [PATCH 12/30] cr: i386 xstate support

2009-04-09 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h|3 +++ kernel/cr/cr-x86_32.c | 49 ++--- 2 files changed, 45 insertions(+), 7 deletions(-) --- a/include/linux/cr.h +++ b/include/linux/cr.h @@ -96,6 +96,9 @@ struct

[Devel] [PATCH 28/30] cr: sockets

2009-04-09 Thread Alexey Dobriyan
Nothing will be dumped because socket file_operations aren't ready. This is one big FIXME item. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cr.h|8 kernel/cr/Makefile|1 kernel/cr/cpt-sys.c |6 +++ kernel/cr/cr-net.c|7 +++ kernel/cr

[Devel] [PATCH 18/30] cr: restore vDSO on i386/x86_64

2009-04-09 Thread Alexey Dobriyan
FIXME: check VMA has same parameters. FIXME: abort if target kernel has vDSO disabled (?) FIXME: restore pages, vDSO is writable after all. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86/vdso/vdso32-setup.c |6 ++ include/linux/cr.h | 11 + include/linux

[Devel] [PATCH 14/30] cr: x86_64 support

2009-04-09 Thread Alexey Dobriyan
FIXME: support more that busyloop Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86/ia32/ia32entry.S|2 arch/x86/include/asm/unistd_64.h |4 include/linux/cr.h | 41 kernel/cr/Makefile |1 kernel/cr/cr-x86_64.c

[Devel] Re: [PATCH 09/30] x86_64: ifdef out struct thread_struct::ip

2009-04-10 Thread Alexey Dobriyan
On Fri, Apr 10, 2009 at 11:19:31AM +0200, Ingo Molnar wrote: * Matt Helsley matth...@us.ibm.com wrote: On Fri, Apr 10, 2009 at 06:35:22AM +0400, Alexey Dobriyan wrote: struct thread_struct::ip isn't used on x86_64, struct pt_regs::ip is used instead. kgdb should be reading 0

[Devel] Re: [PATCH 04/30] ipcns: add create_ipc_ns()

2009-04-10 Thread Alexey Dobriyan
On Fri, Apr 10, 2009 at 11:01:49AM +0200, Ingo Molnar wrote: * Alexey Dobriyan adobri...@gmail.com wrote: --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h @@ -97,6 +97,7 @@ static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; } #if defined

[Devel] Re: [PATCH 00/30] C/R OpenVZ/Virtuozzo style

2009-04-10 Thread Alexey Dobriyan
On Fri, Apr 10, 2009 at 10:28:15AM +0200, Ingo Molnar wrote: * Alexey Dobriyan adobri...@gmail.com wrote: This is to show how we see C/R and to provoke discussion on number of important issues (mounts, ...). This is small part of long-awaited to be cleanuped code. It's able

[Devel] Re: [PATCH 10/30] cr: core stuff

2009-04-10 Thread Alexey Dobriyan
On Fri, Apr 10, 2009 at 11:35:20AM +0200, Ingo Molnar wrote: * Alexey Dobriyan adobri...@gmail.com wrote: +int cr_restore_file(struct cr_context *ctx, loff_t pos) +{ I tried to review this code, but it's almost unreadable to me, Pity you. due to basic code structure mistakes like

[Devel] Re: [PATCH 01/30] headers: fixup cred.h, ipc_namespace.h

2009-04-10 Thread Alexey Dobriyan
On Fri, Apr 10, 2009 at 10:47:47AM +0200, Ingo Molnar wrote: * Alexey Dobriyan adobri...@gmail.com wrote: +struct kern_ipc_perm; Please, not yet another forward declaration... I believe this should be cleaned up properly, instead of sprinkling the kernel with random placed forward

[Devel] Re: [PATCH 07/30] netns: extract net_create()

2009-04-13 Thread Alexey Dobriyan
On Fri, Apr 10, 2009 at 05:56:36PM -0500, Serge E. Hallyn wrote: Quoting Alexey Dobriyan (adobri...@gmail.com): net_create() will be used by C/R code to create fresh netns on restart. Signed-off-by: Alexey Dobriyan adobri...@gmail.com Acked-by: Serge Hallyn se...@us.ibm.com Although

[Devel] Re: [PATCH 00/30] C/R OpenVZ/Virtuozzo style

2009-04-13 Thread Alexey Dobriyan
On Fri, Apr 10, 2009 at 08:06:55AM -0700, Linus Torvalds wrote: On Fri, 10 Apr 2009, Alexey Dobriyan wrote: This is to show how we see C/R and to provoke discussion on number of important issues (mounts, ...). My only initial reaction is that I absolutely hate the naming (not to say I

[Devel] Re: [PATCH 10/30] cr: core stuff

2009-04-13 Thread Alexey Dobriyan
On Fri, Apr 10, 2009 at 12:19:23PM -0400, Brian Haley wrote: Alexey Dobriyan wrote: And of course, I don't want to see multiline vmflags = ~(VM_READ|VM_WRITE| [5 lines skipped] Then why don't you: #define VM_CR_FOO (VM_READ|VM_WRITE|...) vmflags

[Devel] Re: [PATCH 00/30] C/R OpenVZ/Virtuozzo style

2009-04-13 Thread Alexey Dobriyan
On Thu, Apr 09, 2009 at 10:07:11PM -0700, Dave Hansen wrote: I'm curious how you see these fitting in with the work that we've been doing with Oren. Do you mean to just start a discussion or are you really proposing these as an alternative to what Oren has been posting? Yes, this is posted as

[Devel] Re: [PATCH 14/30] cr: x86_64 support

2009-04-13 Thread Alexey Dobriyan
On Fri, Apr 10, 2009 at 06:36:49AM +0400, Alexey Dobriyan wrote: Now x86 matrix of migration is: task/kernel kernel -- i386/i386 = i386 i386/i386 = x86_64 i386/x86_64 = i386 i386

[Devel] Re: [PATCH 00/30] C/R OpenVZ/Virtuozzo style

2009-04-14 Thread Alexey Dobriyan
On Mon, Apr 13, 2009 at 11:39:51AM -0700, Linus Torvalds wrote: On Mon, 13 Apr 2009, Alexey Dobriyan wrote: Well, in OpenVZ everything is in kernel/cpt/ and prefixed with cpt_ and rst_. So? We're not merging OpenVZ code _either_. This is to give example of other prefixes: cpt_

[Devel] Re: [PATCH 00/30] C/R OpenVZ/Virtuozzo style

2009-04-14 Thread Alexey Dobriyan
On Tue, Apr 14, 2009 at 12:26:50AM -0400, Oren Laadan wrote: Alexey Dobriyan wrote: On Thu, Apr 09, 2009 at 10:07:11PM -0700, Dave Hansen wrote: I'm curious how you see these fitting in with the work that we've been doing with Oren. Do you mean to just start a discussion or are you

[Devel] Re: [PATCH 00/30] C/R OpenVZ/Virtuozzo style

2009-04-14 Thread Alexey Dobriyan
. This is incomplete part. But, yes, freeze, dump, thaw/kill as separate actions make sense. checkpoint(CR_CPT_FREEZE); [rsync fs] checkpoint(CR_CPT_DUMP|CR_CPT_KILL); with check that CR_CPT_THAW doesn't happen during dump. * A plethora of FIXME comments ... Alexey Dobriyan wrote

[Devel] Re: [PATCH 10/30] cr: core stuff

2009-04-14 Thread Alexey Dobriyan
On Mon, Apr 13, 2009 at 04:47:01PM -0500, Serge E. Hallyn wrote: Quoting Alexey Dobriyan (adobri...@gmail.com): Hi Alexey, as far as I can see, the main differences between this patch and the equivalent in Oren's tree are: 1. kernel auto-selects container init to freeze Note, auto

[Devel] Re: [PATCH 10/30] cr: core stuff

2009-04-14 Thread Alexey Dobriyan
On Tue, Apr 14, 2009 at 01:22:03AM -0400, Oren Laadan wrote: Alexey Dobriyan wrote: * add struct file_operations::checkpoint The point of hook is to serialize enough information to allow restoration of an opened file. The idea (good one!) is that the code which supplies

[Devel] Re: Creating tasks on restart: userspace vs kernel

2009-04-14 Thread Alexey Dobriyan
On Mon, Apr 13, 2009 at 11:43:30PM -0400, Oren Laadan wrote: For checkpoint/restart (c/r) we need a method to (re)create the tasks tree during restart. There are basically two approaches: in userspace (zap approach) or in the kernel (openvz approach). Once tasks have been created both

[Devel] Re: [PATCH 10/30] cr: core stuff

2009-04-14 Thread Alexey Dobriyan
On Tue, Apr 14, 2009 at 08:41:34AM -0700, Dave Hansen wrote: On Tue, 2009-04-14 at 19:27 +0400, Alexey Dobriyan wrote: Also, since Dave introduced the fops-checkpoint(), we (or at least I) have been struck by the ugly assymetry with checkpoint() being in fops, and restart() not. Do you

[Devel] Re: Creating tasks on restart: userspace vs kernel

2009-04-14 Thread Alexey Dobriyan
1) somebody should write registers before final jump to userspace. Task itself can't generally do it: struct pt_regs is in the same place as kernel stack. cr_load_cpu_regs() does exactly this: as current writes to it's own pt_regs. Oren, why don't you see crashes? I first

[Devel] Re: [PATCH 10/30] cr: core stuff

2009-04-14 Thread Alexey Dobriyan
On Tue, Apr 14, 2009 at 10:41:39AM -0500, Serge E. Hallyn wrote: Quoting Alexey Dobriyan (adobri...@gmail.com): On Mon, Apr 13, 2009 at 04:47:01PM -0500, Serge E. Hallyn wrote: Quoting Alexey Dobriyan (adobri...@gmail.com): Hi Alexey, as far as I can see, the main differences

[Devel] Re: [PATCH 10/30] cr: core stuff

2009-04-14 Thread Alexey Dobriyan
On Tue, Apr 14, 2009 at 10:41:39AM -0500, Serge E. Hallyn wrote: Quoting Alexey Dobriyan (adobri...@gmail.com): On Mon, Apr 13, 2009 at 04:47:01PM -0500, Serge E. Hallyn wrote: Quoting Alexey Dobriyan (adobri...@gmail.com): Hi Alexey, as far as I can see, the main differences

[Devel] Re: [PATCH 10/30] cr: core stuff

2009-04-14 Thread Alexey Dobriyan
On Tue, Apr 14, 2009 at 09:39:50AM -0700, Dave Hansen wrote: On Tue, 2009-04-14 at 20:00 +0400, Alexey Dobriyan wrote: Are you suggesting that conversion of a checkpoint image from an older version to a newer version be done in the kernel ? For mainline kernel it's completely

[Devel] Re: [PATCH 10/30] cr: core stuff

2009-04-14 Thread Alexey Dobriyan
The ability to streamline the checkpoint image IMHO is invaluable. It's the unix way (TM) of doing things; it makes the process pipe-able. You can do many nice things when the checkpoint can be streamed: you can compress, sign, encrypt etc on the fly without taking additional

[Devel] Re: Creating tasks on restart: userspace vs kernel

2009-04-14 Thread Alexey Dobriyan
In the end correctness of chopping will be equal to how good user understands that two task_struct's are independent of each other. But it will still be a useful tool for many use cases, like batch cpu jobs, some servers, vnc sessions (if you want graphics) etc. Imagine you run

[Devel] Re: [PATCH 00/30] C/R OpenVZ/Virtuozzo style

2009-04-14 Thread Alexey Dobriyan
On Tue, Apr 14, 2009 at 03:31:55PM -0400, Oren Laadan wrote: Alexey Dobriyan wrote: On Tue, Apr 14, 2009 at 02:08:21PM -0400, Oren Laadan wrote: Alexey Dobriyan wrote: On Tue, Apr 14, 2009 at 12:26:50AM -0400, Oren Laadan wrote: Alexey Dobriyan wrote: On Thu, Apr 09, 2009 at 10:07

[Devel] Re: [PATCH 00/30] C/R OpenVZ/Virtuozzo style

2009-04-14 Thread Alexey Dobriyan
* not having CAP_SYS_ADMIN on restart(2) Surely you have read already on the containers mailing list that for the *time being* we attempt to get as far as possible without requiring root privileges, to identify security hot-spots. More or less everything is hotspot. Going back to

[Devel] Re: Creating tasks on restart: userspace vs kernel

2009-04-14 Thread Alexey Dobriyan
On Tue, Apr 14, 2009 at 04:10:53PM -0400, Oren Laadan wrote: Alexey Dobriyan wrote: In the end correctness of chopping will be equal to how good user understands that two task_struct's are independent of each other. But it will still be a useful tool for many use cases, like batch cpu

[Devel] Re: CAP_SYS_ADMIN on restart(2)

2009-04-16 Thread Alexey Dobriyan
On Wed, Apr 15, 2009 at 04:16:09PM -0500, Serge E. Hallyn wrote: Quoting Oren Laadan (or...@cs.columbia.edu): Serge E. Hallyn wrote: Quoting Dave Hansen (d...@linux.vnet.ibm.com): On Wed, 2009-04-15 at 23:21 +0400, Alexey Dobriyan wrote: Is sysctl to control CAP_SYS_ADMIN

[Devel] Re: [PATCH 1/1] cr: define CHECKPOINT_SUBTREE flag and sysctl

2009-04-27 Thread Alexey Dobriyan
On Mon, Apr 27, 2009 at 01:07:17PM -0500, Serge E. Hallyn wrote: Heh, because there is no such thing as a 'container'. Oh, yes, there is. Set of tasks shares set of uts_ns, ipc_ns, mnt_ns, pid_ns and net_ns. No other task shares this set. Pid_ns set has tree hierarchy. All user_ns which come

[Devel] Re: checkpoint/restart: taking refcounts on kernel objects

2009-05-01 Thread Alexey Dobriyan
On Tue, Apr 14, 2009 at 10:23:20AM -0700, Dave Hansen wrote: On Tue, 2009-04-14 at 21:04 +0400, Alexey Dobriyan wrote: Right while I have opinions on some things in this list, I didn't mean to imply positions on these items. My question was: are there are differences you want to call

[Devel] [PATCH 1/2] pidns 1/2: make create_pid_namespace() accept parent pidns

2009-05-03 Thread Alexey Dobriyan
create_pid_namespace() creates everything, but caller has to assign parent pidns by hand, which is unnatural. At the moment of call new -level has to be taken from somewhere and parent pidns is already available. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- kernel/pid_namespace.c

[Devel] [PATCH 2/2] pidns 2/2: rewrite copy_pid_ns()

2009-05-03 Thread Alexey Dobriyan
copy_pid_ns() is a perfect example of a case where unwinding leads to more code and makes it less clear. Watch the diffstat. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- kernel/pid_namespace.c | 18 +++--- 1 files changed, 3 insertions(+), 15 deletions(-) diff --git

[Devel] [PATCH 2/2] ipcns 2/2: extract create_ipc_ns()

2009-05-03 Thread Alexey Dobriyan
clone_ipc_ns() is misnamed, it doesn't clone anything and doesn't use passed parameter. Rename it. create_ipc_ns() will be used by C/R to create fresh ipcns. Signed-off-by: Alexey Dobriyan adobri...@gmail.com Acked-by: Serge Hallyn se...@us.ibm.com --- ipc/namespace.c |9 ++--- 1 files

[Devel] [PATCH 1/2] netns 1/2: don't get/put old netns on CLONE_NEWNET

2009-05-03 Thread Alexey Dobriyan
copy_net_ns() doesn't copy anything, it creates fresh netns, so get/put of old netns isn't needed. Signed-off-by: Alexey Dobriyan adobri...@gmail.com Acked-by: Serge Hallyn se...@us.ibm.com --- net/core/net_namespace.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git

[Devel] [PATCH 1/2] ipcns 1/2: remove useless get/put while CLONE_NEWIPC

2009-05-03 Thread Alexey Dobriyan
copy_ipcs() doesn't actually copy anything. If new ipcns is created, it's created from scratch, in this case get/put on old ipcns isn't needed. Signed-off-by: Alexey Dobriyan adobri...@gmail.com Acked-by: Serge Hallyn se...@us.ibm.com --- ipc/namespace.c |6 +- 1 files changed, 1

[Devel] [PATCH 2/2] netns 2/2: extract net_create()

2009-05-03 Thread Alexey Dobriyan
net_create() will be used by C/R to create fresh netns on restart. Signed-off-by: Alexey Dobriyan adobri...@gmail.com Acked-by: Serge Hallyn se...@us.ibm.com --- net/core/net_namespace.c | 44 1 files changed, 20 insertions(+), 24 deletions(-) diff

[Devel] [PATCH 1/2] i386: ifdef out struct thread_struct::fs

2009-05-03 Thread Alexey Dobriyan
stopped touching it after the patch. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86/include/asm/processor.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index c2cceae..a6732ff 100644

[Devel] [PATCH] x86_64: ifdef out struct thread_struct::ip

2009-05-03 Thread Alexey Dobriyan
struct thread_struct::ip isn't used on x86_64, struct pt_regs::ip is used instead. kgdb should be reading 0 always, but I can't check it. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86/include/asm/processor.h |2 ++ arch/x86/kernel/kgdb.c |2 +- 2 files

[Devel] [PATCH] x86: ptrace debugreg checks rewrite

2009-05-03 Thread Alexey Dobriyan
the same way they are checked on PTRACE_POKEUSR. Question 1: TIF_DEBUG can set even if none of breakpoints is turned on, should this be optimized? Question 2: Breakpoints are allowed to be globally enabled, is this a security risk? Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86

[Devel] Re: [PATCH] x86: ptrace debugreg checks rewrite

2009-05-03 Thread Alexey Dobriyan
On Mon, May 04, 2009 at 04:16:01AM +0400, Alexey Dobriyan wrote: +static int ptrace_check_debugreg(int _32bit, + unsigned long dr0, unsigned long dr1, + unsigned long dr2, unsigned long dr3, + unsigned long

[Devel] Re: [PATCH 1/1] cr: use a new capability to authorize c/r

2009-05-12 Thread Alexey Dobriyan
On Tue, May 12, 2009 at 10:07:13AM -0500, Serge E. Hallyn wrote: do you object to this patch? The idea is to not give away any privilege not otherwise needed. --- a/checkpoint/sys.c +++ b/checkpoint/sys.c @@ -281,7 +281,7 @@ asmlinkage long sys_checkpoint(pid_t pid, int fd, unsigned long

[Devel] Re: [PATCH 4/5] cr: checkpoint and restore task credentials

2009-05-14 Thread Alexey Dobriyan
On Mon, May 11, 2009 at 11:05:39AM -0500, Serge E. Hallyn wrote: --- a/checkpoint/objhash.c +++ b/checkpoint/objhash.c +#define CKPT_MAXGROUPS 15 +#define MAX_GROUPINFO_SIZE (sizeof(*h)+CKPT_MAXGROUPS*sizeof(gid_t)) +/* move this fn into kernel/sys.c next to group functions? */ +static int

[Devel] Re: [PATCH 4/5] cr: checkpoint and restore task credentials

2009-05-14 Thread Alexey Dobriyan
On Thu, May 14, 2009 at 12:18:50PM +0400, Alexey Dobriyan wrote: On Mon, May 11, 2009 at 11:05:39AM -0500, Serge E. Hallyn wrote: --- a/checkpoint/objhash.c +++ b/checkpoint/objhash.c +#define CKPT_MAXGROUPS 15 +#define MAX_GROUPINFO_SIZE (sizeof(*h)+CKPT_MAXGROUPS*sizeof(gid_t

[Devel] [PATCH 1/2] ipcns: make free_ipc_ns() static

2009-05-21 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/ipc_namespace.h |1 ipc/namespace.c | 48 +- 2 files changed, 24 insertions(+), 25 deletions(-) --- a/include/linux/ipc_namespace.h +++ b/include/linux

[Devel] [PATCH 2/2] ipcns: move free_ipcs() proto

2009-05-21 Thread Alexey Dobriyan
Function is really private to ipc/ and avoid struct kern_ipc_perm forward declaration. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/ipc_namespace.h |4 ipc/util.h|3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) --- a/include

[Devel] [PATCH 01/38] cred: #include init.h in cred.h

2009-05-21 Thread Alexey Dobriyan
cred.h can't be included as first header because it uses __init and doesn't include init.h which is enough to break compilation on at least ia64. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/cred.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git

[Devel] [PATCH 11/38] nsproxy: extract create_nsproxy()

2009-05-21 Thread Alexey Dobriyan
clone_nsproxy() does useless copying of old nsproxy -- every pointer will be rewritten to new ns or to old ns. Remove copying, rename clone_nsproxy(), create_nsproxy() will be used by C/R code to create fresh nsproxy on restart. Signed-off-by: Alexey Dobriyan adobri...@gmail.com Acked-by: Serge

[Devel] [PATCH 02/38] utsns: extract create_uts_ns()

2009-05-21 Thread Alexey Dobriyan
create_uts_ns() will be used by C/R to create fresh uts_ns. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- kernel/utsname.c | 13 +++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/kernel/utsname.c b/kernel/utsname.c index 815237a..8a82b4b 100644 --- a/kernel

[Devel] [PATCH 04/38] ipcns 2/4: extract create_ipc_ns()

2009-05-21 Thread Alexey Dobriyan
clone_ipc_ns() is misnamed, it doesn't clone anything and doesn't use passed parameter. Rename it. create_ipc_ns() will be used by C/R to create fresh ipcns. Signed-off-by: Alexey Dobriyan adobri...@gmail.com Acked-by: Serge Hallyn se...@us.ibm.com --- ipc/namespace.c |9 ++--- 1 files

[Devel] [PATCH 07/38] pidns 1/2: make create_pid_namespace() accept parent pidns

2009-05-21 Thread Alexey Dobriyan
create_pid_namespace() creates everything, but caller has to assign parent pidns by hand, which is unnatural. At the moment of call new -level has to be taken from somewhere and parent pidns is already available. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- kernel/pid_namespace.c

[Devel] [PATCH 05/38] ipcns 3/4: make free_ipc_ns() static

2009-05-21 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/ipc_namespace.h |1 - ipc/namespace.c | 48 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/include/linux/ipc_namespace.h b/include/linux

[Devel] [PATCH 08/38] pidns 2/2: rewrite copy_pid_ns()

2009-05-21 Thread Alexey Dobriyan
copy_pid_ns() is a perfect example of a case where unwinding leads to more code and makes it less clear. Watch the diffstat. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- kernel/pid_namespace.c | 18 +++--- 1 files changed, 3 insertions(+), 15 deletions(-) diff --git

[Devel] [PATCH 06/38] ipcns 4/2: move free_ipcs() proto

2009-05-21 Thread Alexey Dobriyan
Function is really private to ipc/ and avoid struct kern_ipc_perm forward declaration. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/ipc_namespace.h |4 ipc/util.h|3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git

[Devel] [PATCH 09/38] netns 1/2: don't get/put old netns on CLONE_NEWNET

2009-05-21 Thread Alexey Dobriyan
copy_net_ns() doesn't copy anything, it creates fresh netns, so get/put of old netns isn't needed. Signed-off-by: Alexey Dobriyan adobri...@gmail.com Acked-by: Serge Hallyn se...@us.ibm.com --- net/core/net_namespace.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git

[Devel] [PATCH 12/38] i386: ifdef out struct thread_struct::fs

2009-05-21 Thread Alexey Dobriyan
stopped touching it after the patch. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86/include/asm/processor.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index c2cceae..a6732ff 100644

[Devel] [PATCH 13/38] x86_64: ifdef out struct thread_struct::ip

2009-05-21 Thread Alexey Dobriyan
struct thread_struct::ip isn't used on x86_64, struct pt_regs::ip is used instead. kgdb should be reading 0 always, but I can't check it. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86/include/asm/processor.h |2 ++ arch/x86/kernel/kgdb.c |2 +- 2 files

[Devel] [PATCH 14/38] Remove struct mm_struct::exe_file et al

2009-05-21 Thread Alexey Dobriyan
, no need to save and restore -exe_file and to count additional references to check if there is a leak of struct file outside group of checkpointed resources. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- fs/exec.c|2 - fs/proc/base.c | 105

[Devel] [PATCH 27/38] C/R: checkpoint/restore struct uts_namespace

2009-05-21 Thread Alexey Dobriyan
to something like: if (ctx-dump_live) down_read(uts_sem); ... if (ctx-dump_live) up_read(uts_sem); Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/kstate-image.h | 14 + include/linux/kstate.h |5

[Devel] [PATCH 31/38] C/R: formally checkpoint/restore struct net_namespace

2009-05-21 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/kstate-image.h |6 ++ include/linux/kstate.h | 19 +++ include/net/net_namespace.h|1 + kernel/kstate/cpt-sys.c|6 ++ kernel/kstate/kstate-context.c |8 +++ kernel/kstate/kstate

[Devel] [PATCH 17/38] groups: move code to kernel/groups.c

2009-05-21 Thread Alexey Dobriyan
Move supplementary groups implementation to kernel/groups.c . kernel/sys.c already accumulated quite a few random stuff. Do strictly copy/paste + add required headers to compile. Compile-tested on many configs and archs. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- kernel/Makefile

[Devel] [PATCH 25/38] C/R: x86_64 xstate

2009-05-21 Thread Alexey Dobriyan
Again, checks aren't enough on all counts. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/kstate-image.h |3 ++ kernel/kstate/kstate-x86_64.c | 44 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/include/linux

[Devel] [PATCH 23/38] C/R: x86_64 support

2009-05-21 Thread Alexey Dobriyan
In theory and in practice, x86_64 COMPAT=y kernel will restore i386 images and in other direction. There are small problems still and it doesn't work, but mentioning anyway. Right now x86_64 kernel restores only x86_64 images and 64-bit tasks. Signed-off-by: Alexey Dobriyan adobri...@gmail.com

[Devel] [PATCH 33/38] C/R: checkpoint/restore aux groups (structy group_info)

2009-05-21 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/kstate-image.h | 10 +++ include/linux/kstate.h |5 ++ kernel/cred.c | 30 +- kernel/groups.c| 125 kernel/kstate/cpt-sys.c

[Devel] [PATCH 20/38] C/R: i386 support

2009-05-21 Thread Alexey Dobriyan
Segment registers are abstracted to allow i386 = x86_64 migration (BTW, I'm not so sure if just making 32-bit selectors the same will achieve same effect) Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86/include/asm/unistd_32.h |2 + arch/x86/kernel/syscall_table_32.S |2

[Devel] [PATCH 35/38] C/R: checkpoint/restore struct user_namespace

2009-05-21 Thread Alexey Dobriyan
We have first loop -- user-user_ns-creator (which is struct user_struct) user_ns image references -creator image but only partially because user_namespaces are dumped before user_structs. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/kstate-image.h | 12 +++ include

[Devel] [PATCH 32/38] C/R: checkpoint/restore struct cred

2009-05-21 Thread Alexey Dobriyan
-group_info, -user will be done in next patches FIXME: insufficient checks for capabilities at least. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/kstate-image.h | 25 ++ include/linux/kstate.h |5 + kernel/cred.c | 164

[Devel] [PATCH 28/38] C/R: formally checkpoint/restore struct ipc_namespace

2009-05-21 Thread Alexey Dobriyan
No IPC objects are done yet, only struct ipc_namespace itself and tsk-nsproxy-ipc_ns skeleton. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/ipc_namespace.h |3 + include/linux/kstate-image.h |6 ++ include/linux/kstate.h | 19 ipc/namespace.c

[Devel] Re: [PATCH 01/38] cred: #include init.h in cred.h

2009-05-21 Thread Alexey Dobriyan
More patches before [PATCH 18/38] C/R: core stuff were already sent via usual channels and some are already in -next. There are being repeated to maintain clean series against mainline. I forgot to mention that -checkpoint hook was not added to vDSO mapping for several reasons so if someone want

[Devel] [PATCH 21/38] C/R: i386 debug registers

2009-05-21 Thread Alexey Dobriyan
Make extensive checks to not allow restoration of breakpoints inside kernel code. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86/include/asm/ptrace.h |5 + arch/x86/kernel/ptrace.c |8 include/linux/kstate-image.h |7 +++ kernel/kstate/kstate

[Devel] [PATCH 24/38] C/R: x86_64 debug registers

2009-05-21 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/kstate-image.h |7 +++ kernel/kstate/kstate-x86_64.c | 26 ++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/include/linux/kstate-image.h b/include/linux/kstate-image.h index

[Devel] [PATCH 22/38] C/R: i386 xstate

2009-05-21 Thread Alexey Dobriyan
The only check is if xstate length doesn't match. This is insufficient, but posted anyway, because glibc manages to do FP calculations and create xstate which would prevent checkpointing. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/kstate-image.h |3 ++ kernel

[Devel] [PATCH 26/38] C/R: nsproxy

2009-05-21 Thread Alexey Dobriyan
- dump nsproxy as KSTATE_OBJ_NSPROXY type filled with references - on restore, read reference, read and restore namespace if needed, bump refcount, glue namespace to nsproxy. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/kstate-image.h |6 ++ include/linux/kstate.h

[Devel] [PATCH 37/38] C/R: checkpoint/restore opened files

2009-05-21 Thread Alexey Dobriyan
File descriptor is dumped as formally an object, despite it can't be shared by itself, only files_struct can. Opening is done, veryfying that we opened right file, restoration of file position and nothing more. Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- include/linux/kstate-image.h

[Devel] [PATCH 16/38] x86: ptrace debugreg checks rewrite

2009-05-22 Thread Alexey Dobriyan
the same way they are checked on PTRACE_POKEUSR. Question 1: TIF_DEBUG can set even if none of breakpoints is turned on, should this be optimized? Question 2: Breakpoints are allowed to be globally enabled, is this a security risk? Signed-off-by: Alexey Dobriyan adobri...@gmail.com --- arch/x86

<    1   2   3   4   5   >