Re: [Devel] Device Namespaces

2013-10-21 Thread Serge Hallyn
Quoting Eric W. Biederman (ebied...@xmission.com): Serge E. Hallyn se...@hallyn.com writes: Quoting Andy Lutomirski (l...@amacapital.net): On Tue, Oct 1, 2013 at 7:19 AM, Janne Karhunen janne.karhu...@gmail.com wrote: On Thu, Sep 26, 2013 at 8:33 AM, Greg Kroah-Hartman gre

[Devel] Re: [PATCH v6 01/10] ipc: remove forced assignment of selected message

2012-10-23 Thread Serge Hallyn
Quoting Stanislav Kinsbursky (skinsbur...@parallels.com): This is a cleanup patch. The assignment is redundant. Signed-off-by: Stanislav Kinsbursky skinsbur...@parallels.com Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com --- ipc/msg.c |5 + 1 files changed, 1 insertions(+), 4

[Devel] Re: [PATCH v6 03/10] ipc: segment key change helper introduced

2012-10-23 Thread Serge Hallyn
key is not used. Signed-off-by: Stanislav Kinsbursky skinsbur...@parallels.com Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com --- ipc/compat.c |6 ++ ipc/util.c | 51 --- ipc/util.h |2 ++ 3 files changed, 56 insertions

[Devel] Re: [PATCH v6 06/10] glge driver: rename internal SEM_SET macro to SEM_INIT

2012-10-23 Thread Serge Hallyn
are originally created by replacing IPC_ part by SEM_(MSG_, SHM_) part. So, I'm hoping, that this change doesn't really matters for QLogic qlge NIC Can't speak for the driver maintainer, but it does look sane. Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com HBA Driver developers, since it's just

[Devel] Re: [PATCH v6 07/10] ipc: add new SEM_SET command for sys_semctl() call

2012-10-23 Thread Serge Hallyn
is returned. Signed-off-by: Stanislav Kinsbursky skinsbur...@parallels.com Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com (again, modulo requested /* fallthrough */ comment ) --- include/uapi/linux/sem.h |1 + ipc/compat.c |1 + ipc/sem.c | 10

[Devel] Re: [PATCH v6 05/10] ipc: add new MSG_SET command for sys_msgctl() call

2012-10-23 Thread Serge Hallyn
is returned. Signed-off-by: Stanislav Kinsbursky skinsbur...@parallels.com Acked-by: Serge E. Hallyn serge.hal...@ubuntu.com --- include/uapi/linux/msg.h |1 + ipc/compat.c |1 + ipc/msg.c | 13 +++-- security/selinux/hooks.c |1

[Devel] Re: [PATCH v6 09/10] IPC: message queue copy feature introduced

2012-10-23 Thread Serge Hallyn
Quoting Stanislav Kinsbursky (skinsbur...@parallels.com): This patch is required for checkpoint/restore in userspace. IOW, c/r requires some way to get all pending IPC messages without deleting them from the queue (checkpoint can fail and in this case tasks will be resumed, so queue have to

[Devel] Re: [PATCH v6 06/10] glge driver: rename internal SEM_SET macro to SEM_INIT

2012-10-23 Thread Serge Hallyn
Quoting Jitendra Kalsaria (jitendra.kalsa...@qlogic.com): From: Serge Hallyn [mailto:serge.hal...@canonical.com] Sent: Tuesday, October 23, 2012 9:33 AM To: Stanislav Kinsbursky Cc: a...@linux-foundation.org; catalin.mari...@arm.com; will.dea...@arm.com; dhowe...@redhat.com; manf

[Devel] Re: [PATCH v5 01/10] ipc: remove forced assignment of selected message

2012-09-26 Thread Serge Hallyn
Quoting Stanislav Kinsbursky (skinsbur...@parallels.com): This is a cleanup patch. The assignment is redundant. Signed-off-by: Stanislav Kinsbursky skinsbur...@parallels.com --- ipc/msg.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/ipc/msg.c b/ipc/msg.c

[Devel] Re: containers and cgroups mini-summit @ Linux Plumbers

2012-07-26 Thread Serge Hallyn
Quoting Eric W. Biederman (ebied...@xmission.com): Glauber Costa glom...@parallels.com writes: I just came up with the following preliminary list of sessions: http://wiki.linuxplumbersconf.org/2012:containers Since people mostly said what they wanted to talk about, but without

Re: [Devel] Re: containers and cgroups mini-summit @ Linux Plumbers

2012-07-26 Thread Serge Hallyn
allows you to raise your own limits, worthless). The 'fake cgroup root' has been mentioned before to address this. Definately worth discussing. thanks, -serge ___ Devel mailing list Devel@openvz.org https://openvz.org/mailman/listinfo/devel

[Devel] Re: containers and cgroups mini-summit @ Linux Plumbers

2012-07-25 Thread Serge Hallyn
Quoting Glauber Costa (glom...@parallels.com): On 07/12/2012 01:41 AM, Kir Kolyshkin wrote: Gentlemen, We are organizing containers mini-summit during next Linux Plumbers (San Diego, August 29-31). The idea is to gather and discuss everything relevant to namespaces, cgroups, resource

[Devel] Re: containers and cgroups mini-summit @ Linux Plumbers

2012-07-16 Thread Serge Hallyn
Quoting Kir Kolyshkin (k...@openvz.org): On 07/12/2012 07:47 AM, Serge Hallyn wrote: Quoting Kir Kolyshkin (k...@openvz.org): Gentlemen, We are organizing containers mini-summit during next Linux Plumbers (San Diego, August 29-31). The idea is to gather and discuss everything relevant

[Devel] Re: containers and cgroups mini-summit @ Linux Plumbers

2012-07-11 Thread Serge Hallyn
Quoting Kir Kolyshkin (k...@openvz.org): Gentlemen, We are organizing containers mini-summit during next Linux Plumbers (San Diego, August 29-31). The idea is to gather and discuss everything relevant to namespaces, cgroups, resource management, checkpoint-restore and so on. We are

[Devel] Re: [PATCH 0/5] per-cpu/cpuacct cgroup scheduler statistics

2012-02-14 Thread Serge Hallyn
it. -serge ___ Devel mailing list Devel@openvz.org https://openvz.org/mailman/listinfo/devel

[Devel] Re: [PATCH 2/9] security: Make capabilities relative to the user namespace.

2011-02-23 Thread Serge E. Hallyn
the caps for the privileged ancestors as described above. thanks, -serge ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ___ Devel

[Devel] Re: User namespaces and keys

2011-02-23 Thread Serge E. Hallyn
over a file if needed. I'm going to not consider the TPM at the moment :) Possibly the trickiest problem with keys is how to upcall key construction to /sbin/request-key when the keys may be of a different user namespace. Hm, jinkeys, yes. -serge

[Devel] Re: User namespaces and keys

2011-02-23 Thread Serge E. Hallyn
Quoting Eric W. Biederman (ebied...@xmission.com): David Howells dhowe...@redhat.com writes: Serge E. Hallyn se...@hallyn.com wrote: I guess we need to look at how to mix keys and namespaces again. From strictly kernel pov, at the moment, keys are strictly usable only by the user

[Devel] [PATCH 1/4] userns: let clone_uts_ns() handle setting uts-user_ns

2011-02-23 Thread Serge E. Hallyn
To do so we need to pass in the task_struct who'll get the utsname, so we can get its user_ns. Changelog: Feb 23: As per Oleg's coment, just pass in tsk. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/utsname.h |6 +++--- kernel/nsproxy.c|7

[Devel] [PATCH 2/4] userns: let copy_ipcs handle setting ipc_ns-user_ns

2011-02-23 Thread Serge E. Hallyn
To do that, we have to pass in the task_struct of the task which will own the ipc_ns, so we can assign its user_ns. Changelog: Feb 23: As per Oleg comment, just pass in tsk. To get the ipc_ns from the nsproxy we need to include nsproxy.h Signed-off-by: Serge E. Hallyn

[Devel] [PATCH 5/4] Clean up capability.h and capability.c

2011-02-23 Thread Serge E. Hallyn
-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/capability.h | 38 ++ include/linux/cred.h |4 +++- kernel/capability.c| 20 kernel/cred.c |5 + 4 files changed, 46 insertions(+), 21

[Devel] Re: [PATCH 5/9] Allow ptrace from non-init user namespaces

2011-02-23 Thread Serge E. Hallyn
Quoting Andrew Morton (a...@linux-foundation.org): On Thu, 17 Feb 2011 15:03:33 + Serge E. Hallyn se...@hallyn.com wrote: ptrace is allowed to tasks in the same user namespace according to the usual rules (i.e. the same rules as for two tasks in the init user namespace). ptrace

[Devel] Re: [PATCH 4/9] allow killing tasks in your own or child userns

2011-02-23 Thread Serge E. Hallyn
Quoting Andrew Morton (a...@linux-foundation.org): On Thu, 17 Feb 2011 15:03:25 + Serge E. Hallyn se...@hallyn.com wrote: /* + * called with RCU read lock from check_kill_permission() + */ +static inline int kill_ok_by_cred(struct task_struct *t) +{ + const struct cred *cred

[Devel] [PATCH] userns: ptrace: incorporate feedback from Eric

2011-02-23 Thread Serge E. Hallyn
same_or_ancestore_user_ns() was not an appropriate check to constrain cap_issubset. Rather, cap_issubset() only is meaningful when both capsets are in the same user_ns. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/user_namespace.h |9 - kernel

[Devel] Re: [PATCH] userns: ptrace: incorporate feedback from Eric

2011-02-23 Thread Serge E. Hallyn
Quoting Andrew Morton (a...@linux-foundation.org): On Thu, 24 Feb 2011 00:49:01 + Serge E. Hallyn se...@hallyn.com wrote: same_or_ancestore_user_ns() was not an appropriate check to constrain cap_issubset. Rather, cap_issubset() only is meaningful when both capsets are in the same

[Devel] Re: [PATCH 1/4] userns: let clone_uts_ns() handle setting uts-user_ns

2011-02-21 Thread Serge E. Hallyn
Quoting Oleg Nesterov (o...@redhat.com): On 02/21, Daniel Lezcano wrote: On 02/21/2011 05:01 AM, Serge E. Hallyn wrote: To do so we need to pass in the task_struct who'll get the utsname, so we can get its user_ns. -extern struct uts_namespace *copy_utsname(unsigned long flags

[Devel] Re: [PATCH 1/1][3rd resend] sys_unshare: remove the dead CLONE_THREAD/SIGHAND/VM code

2011-02-20 Thread Serge E. Hallyn
. Acked-by: Serge Hallyn serge.hal...@canonical.com thanks, -serge --- kernel/fork.c | 123 +++--- 1 file changed, 25 insertions(+), 98 deletions(-) --- 2.6.37/kernel/fork.c~unshare-killcrap 2010-11-05 18:03:28.0 +0100

[Devel] [PATCH 1/4] userns: let clone_uts_ns() handle setting uts-user_ns

2011-02-20 Thread Serge E. Hallyn
To do so we need to pass in the task_struct who'll get the utsname, so we can get its user_ns. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/utsname.h | 10 ++ kernel/nsproxy.c|7 +-- kernel/utsname.c| 12 +++- 3 files

[Devel] [PATCH 2/4] userns: let copy_ipcs handle setting ipc_ns-user_ns

2011-02-20 Thread Serge E. Hallyn
To do that, we have to pass in the task_struct of the task which will own the ipc_ns, so we can assign its user_ns. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/ipc_namespace.h |8 +--- ipc/namespace.c | 12 +++- kernel/nsproxy.c

[Devel] [PATCH 3/4] Add the required user_ns parameter to security_capable

2011-02-20 Thread Serge E. Hallyn
Fixes a compile failure. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- drivers/pci/pci-sysfs.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index ea25e5b..90a6b04 100644 --- a/drivers/pci/pci-sysfs.c

[Devel] [PATCH 4/4] userns: uts and ipc: fix checkpatch warning

2011-02-20 Thread Serge E. Hallyn
As pointed out by Andrew Morton (and checkpatch), init/version.c (and ipc/msgutil.c) should not have an extern declaration for init_user_ns. Instead, move those to ipc_namespace.h and utsname.h. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/ipc_namespace.h |3

[Devel] Re: [PATCH] Reduce uidhash lock hold time when lookup succeeds

2011-02-18 Thread Serge E. Hallyn
: David Howells dhowe...@redhat.com Cc: Pavel Emelyanov xe...@parallels.com Cc: Alexey Dobriyan adobri...@gmail.com Cc: Serge E. Hallyn se...@hallyn.com Acked-by: Serge E. Hallyn se...@hallyn.com And might I say that the label 'out_unlock' in that function is sadly named :) Cc: contain

[Devel] userns: targeted capabilities v5

2011-02-17 Thread Serge E. Hallyn
to get useful for some sandboxing. I've run the 'runltplite.sh' with and without this patchset and found no difference. So all in all, this is the first version of this patchset for which I feel comfortable asking: please consider applying. thanks, -serge

[Devel] [PATCH 2/9] security: Make capabilities relative to the user namespace.

2011-02-17 Thread Serge E. Hallyn
potential uid confusion issues left. I still need to handle getting all caps after creation but otherwise I think I have a good starter patch that achieves all of your goals. Changelog: 11/05/2010: [serge] add apparmor 12/14/2010: [serge] fix capabilities to created user namespaces

[Devel] [PATCH 9/9] userns: check user namespace for task-file uid equivalence checks

2011-02-17 Thread Serge E. Hallyn
Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- fs/inode.c | 17 + fs/namei.c | 20 +++- include/linux/fs.h |9 +++-- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index da85e56

[Devel] [PATCH 7/9] add a user namespace owner of ipc ns

2011-02-17 Thread Serge E. Hallyn
Changelog: Feb 15: Don't set new ipc-user_ns if we didn't create a new ipc_ns. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/ipc_namespace.h |3 +++ ipc/msgutil.c |3 +++ ipc/namespace.c |9

[Devel] [PATCH 1/9] Add a user_namespace as creator/owner of uts_namespace

2011-02-17 Thread Serge E. Hallyn
it. Changelog: Feb 15: don't set uts_ns-user_ns if we didn't create a new uts_ns. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/utsname.h |3 +++ init/version.c |2 ++ kernel/nsproxy.c|5 + kernel/user.c

[Devel] [PATCH 3/9] allow sethostname in a container

2011-02-17 Thread Serge E. Hallyn
Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- kernel/sys.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 18da702..7a1bbad 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1177,7 +1177,7 @@ SYSCALL_DEFINE2(sethostname

[Devel] [PATCH 6/9] user namespaces: convert all capable checks in kernel/sys.c

2011-02-17 Thread Serge E. Hallyn
11: Fix logic errors in uid checks pointed out by Bastian. Feb 15: allow prlimit to current (was regression in previous version) Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- kernel/sys.c | 74 - 1 files changed, 47

[Devel] [PATCH 4/9] allow killing tasks in your own or child userns

2011-02-17 Thread Serge E. Hallyn
need cred/tcred in check_kill_permission. Jan 1: use const cred struct. Jan 11: Per Bastian Blank's advice, clean up kill_ok_by_cred(). Feb 16: kill_ok_by_cred: fix bad parentheses Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- kernel/signal.c | 30

[Devel] [PATCH 8/9] user namespaces: convert several capable() calls

2011-02-17 Thread Serge E. Hallyn
of sched_capable(). Jan 11: Use nsown_capable() as suggested by Bastian Blank. Jan 11: Clarify (hopefully) some logic in futex and sched.c Feb 15: use ns_capable for ipc, not nsown_capable Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- ipc/shm.c |2

[Devel] [PATCH 5/9] Allow ptrace from non-init user namespaces

2011-02-17 Thread Serge E. Hallyn
feedback by Eric: . Correct ptrace uid check . Rename may_ptrace_ns to ptrace_capable . Also fix the cap_ptrace checks. Jan 1: Use const cred struct Jan 11: use task_ns_capable() in place of ptrace_capable(). Signed-off-by: Serge E. Hallyn

[Devel] Re: userns: targeted capabilities v5

2011-02-17 Thread Serge E. Hallyn
Quoting Andrew Morton (a...@linux-foundation.org): On Thu, 17 Feb 2011 15:02:24 + Serge E. Hallyn se...@hallyn.com wrote: Here is a repost of my previous user namespace patch, ported onto last night's git head. It fixes several things I was doing wrong in the last (v4) posting

[Devel] Re: [PATCH 5/9] Allow ptrace from non-init user namespaces

2011-02-17 Thread Serge E. Hallyn
Quoting Eric W. Biederman (ebied...@xmission.com): Serge E. Hallyn se...@hallyn.com writes: ptrace is allowed to tasks in the same user namespace according to the usual rules (i.e. the same rules as for two tasks in the init user namespace). ptrace is also allowed to a user namespace

[Devel] Re: [PATCH 1/3] pid: Remove the child_reaper special case in init/main.c

2011-02-16 Thread Serge E. Hallyn
-by: Eric W. Biederman ebied...@xmission.com Signed-off-by: Daniel Lezcano daniel.lezc...@free.fr Acked-by: Serge E. Hallyn se...@hallyn.com --- include/linux/pid.h | 11 +++ init/main.c |9 - kernel/fork.c |2 +- 3 files changed, 12 insertions(+), 10

[Devel] Re: [PATCH 2/3] pidns: Call pid_ns_prepare_proc from create_pid_namespace

2011-02-16 Thread Serge E. Hallyn
daniel.lezc...@free.fr Acked-by: Serge E. Hallyn se...@hallyn.com --- fs/proc/root.c | 25 +++-- kernel/fork.c |6 -- kernel/pid_namespace.c | 11 +-- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/fs/proc/root.c b/fs/proc

[Devel] Re: [PATCH 3/3] procfs: kill the global proc_mnt variable

2011-02-16 Thread Serge E. Hallyn
Signed-off-by: Daniel Lezcano daniel.lezc...@free.fr Acked-by: Serge E. Hallyn se...@hallyn.com --- fs/proc/inode.c|2 -- fs/proc/internal.h |1 - fs/proc/root.c |7 --- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c

[Devel] [user-cr PATCH 1/1] Fix x86-64 syscall numbers

2011-02-14 Thread Serge E. Hallyn
Signed-off-by: Serge Hallyn serge.hal...@canonical.com --- clone_x86_64.c |2 +- include/linux/checkpoint.h |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clone_x86_64.c b/clone_x86_64.c index 5a22093..6750786 100644 --- a/clone_x86_64.c +++ b

[Devel] [linux-cr PATCH 1/1] update x86-64 eclone and cr syscall numbers

2011-02-14 Thread Serge E. Hallyn
(for ckpt-v23-rc1-pids branch) Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- arch/x86/include/asm/unistd_64.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index 706d90a..f5d1b9e

[Devel] cr: fix trivial compile error

2011-02-13 Thread Serge E. Hallyn
diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c index 5bff486..6261993 100644 --- a/fs/sysv/dir.c +++ b/fs/sysv/dir.c @@ -25,7 +25,6 @@ const struct file_operations sysv_dir_operations = { .read = generic_read_dir, .readdir= sysv_readdir, .fsync =

[Devel] if you use user namespaces

2011-02-06 Thread Serge E. Hallyn
. Otherwise, I'd like to get serious soon about expanding upon, and pushing upstream, the patches to make CLONE_NEWUSER more useful for sandboxing. thanks, -serge ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org

[Devel] Re: [PATCH 03/08] allow sethostname in a container

2011-02-04 Thread Serge E. Hallyn
Quoting Serge E. Hallyn (se...@hallyn.com): Quoting Serge E. Hallyn (se...@hallyn.com): Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- kernel/sys.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 2745dcd

[Devel] Re: device(s) namespace

2011-01-28 Thread Serge E. Hallyn
). A link which was referenced in one of those emails: https://lists.linux-foundation.org/pipermail/containers/2008-April/010810.html So while I'm pretty sure I have in the past seen discussions on what the device namespace would look like, they must have been on irc or in person. -serge

[Devel] udev in containers

2011-01-28 Thread Serge E. Hallyn
to another device more completely than simply fudging the nodes under /dev. Comments? Designs? Plans? thanks, -serge ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers

[Devel] Re: udev in containers

2011-01-28 Thread Serge E. Hallyn
Quoting Eric W. Biederman (ebied...@xmission.com): Serge E. Hallyn serge.hal...@canonical.com writes: Hi, Now that we are allowing udev to run in containers, Daniel has noticed that updates to sysfs uevent files will trigger a flurry of activity in all containers on the host. While

[Devel] Re: device(s) namespace

2011-01-27 Thread Serge E. Hallyn
to past/current discussions are welcome :) I'm hoping to get my archive disk out this weekend or monday and search for these, if noone else finds them before that. -serge ___ Containers mailing list contain...@lists.linux-foundation.org https

[Devel] Re: [PATCH 4/7] allow killing tasks in your own or child userns

2011-01-15 Thread Serge E. Hallyn
Quoting Bastian Blank (bast...@waldi.eu.org): On Sat, Jan 15, 2011 at 12:31:14AM +, Serge E. Hallyn wrote: Quoting Bastian Blank (bast...@waldi.eu.org): On Tue, Jan 11, 2011 at 01:31:52AM +, Serge E. Hallyn wrote: Quoting Bastian Blank (bast...@waldi.eu.org): What

[Devel] Re: [PATCH 4/7] allow killing tasks in your own or child userns

2011-01-14 Thread Serge E. Hallyn
Quoting Bastian Blank (bast...@waldi.eu.org): On Tue, Jan 11, 2011 at 01:31:52AM +, Serge E. Hallyn wrote: Quoting Bastian Blank (bast...@waldi.eu.org): What is this flag used for anyway? I only see it used in the accounting stuff, and if every user can get it, it is not longer useful

[Devel] Re: [PATCH 03/08] allow sethostname in a container

2011-01-11 Thread Serge E. Hallyn
Quoting Serge E. Hallyn (se...@hallyn.com): Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- kernel/sys.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 2745dcd..9b9b03b 100644 --- a/kernel/sys.c +++ b/kernel/sys.c

[Devel] Re: Containers and /proc/sys/vm/drop_caches

2011-01-11 Thread Serge Hallyn
Quoting Rob Landley (rland...@parallels.com): On 01/07/2011 09:12 AM, Serge Hallyn wrote: Changing ownership so a script can't open a file that it otherwise could may cause scripts to fail when run in a container. Makes the containers less transparent. While my goal next week

[Devel] userns: targeted capabilities v3

2011-01-10 Thread Serge E. Hallyn
be to re-introduce a part of a several year old patchset which assigns a userns to a superblock (and hence to inodes), and grants 'user other' permissions to any task whose uid does not map to the target userns. (By default, this will be all but the initial userns) thanks, -serge

[Devel] [PATCH 1/7] Add a user_namespace as creator/owner of uts_namespace

2011-01-10 Thread Serge E. Hallyn
it. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/utsname.h |3 +++ init/version.c |2 ++ kernel/nsproxy.c|3 +++ kernel/user.c |8 ++-- kernel/utsname.c|4 5 files changed, 18 insertions(+), 2 deletions(-) diff

[Devel] [PATCH 3/7] allow sethostname in a container

2011-01-10 Thread Serge E. Hallyn
Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- kernel/sys.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 2745dcd..9b9b03b 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1171,7 +1171,7 @@ SYSCALL_DEFINE2(sethostname

[Devel] [PATCH 4/7] allow killing tasks in your own or child userns

2011-01-10 Thread Serge E. Hallyn
need cred/tcred in check_kill_permission. Jan 1: use const cred struct. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com Reviewed-by: Eric W. Biederman ebied...@xmission.com --- kernel/signal.c | 36 1 files changed, 28 insertions(+), 8

[Devel] [PATCH 2/7] security: Make capabilities relative to the user namespace.

2011-01-10 Thread Serge E. Hallyn
potential uid confusion issues left. I still need to handle getting all caps after creation but otherwise I think I have a good starter patch that achieves all of your goals. Changelog: 11/05/2010: [serge] add apparmor 12/14/2010: [serge] fix capabilities to created user namespaces

[Devel] [PATCH 5/7] Allow ptrace from non-init user namespaces

2011-01-10 Thread Serge E. Hallyn
feedback by Eric: . Correct ptrace uid check . Rename may_ptrace_ns to ptrace_capable . Also fix the cap_ptrace checks. Jan 1: Use const cred struct Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/capability.h |2

[Devel] [PATCH 6/7] user namespaces: convert all capable checks in kernel/sys.c

2011-01-10 Thread Serge E. Hallyn
This allows setuid/setgid in containers. It also fixes some corner cases where kernel logic foregoes capability checks when uids are equivalent. The latter will need to be done throughout the whole kernel. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- kernel/sys.c | 35

[Devel] [PATCH 7/7] user namespaces: convert several capable() calls

2011-01-10 Thread Serge E. Hallyn
CAP_IPC_OWNER and CAP_IPC_LOCK can be checked against current_user_ns(), because the resource comes from current's own ipc namespace. setuid/setgid are to uids in own namespace, so again checks can be against current_user_ns(). Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- ipc

[Devel] Re: [PATCH 4/7] allow killing tasks in your own or child userns

2011-01-10 Thread Serge Hallyn
Quoting Bastian Blank (bast...@waldi.eu.org): On Mon, Jan 10, 2011 at 09:13:34PM +, Serge E. Hallyn wrote: + const struct cred *cred = current_cred(); + const struct cred *tcred = __task_cred(t); + + if (cred-user-user_ns != tcred-user-user_ns) { + /* userids

[Devel] Re: [PATCH 6/7] user namespaces: convert all capable checks in kernel/sys.c

2011-01-10 Thread Serge Hallyn
Quoting Bastian Blank (bast...@waldi.eu.org): On Mon, Jan 10, 2011 at 09:14:07PM +, Serge E. Hallyn wrote: - if (pcred-uid != cred-euid - pcred-euid != cred-euid !capable(CAP_SYS_NICE)) { + if (pcred-user-user_ns != cred-user-user_ns + pcred-uid != cred-euid

[Devel] Re: [PATCH 4/7] allow killing tasks in your own or child userns

2011-01-10 Thread Serge E. Hallyn
Quoting Bastian Blank (bast...@waldi.eu.org): On Mon, Jan 10, 2011 at 04:51:51PM -0600, Serge Hallyn wrote: Quoting Bastian Blank (bast...@waldi.eu.org): Isn't that equal to this? if (ns_capable(tcred-user-user_ns, CAP_KILL)) return 1; if (cred-user-user_ns

[Devel] Re: [PATCH 4/7] allow killing tasks in your own or child userns

2011-01-10 Thread Serge E. Hallyn
we decide to nuke the flag) thanks, -serge ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ___ Devel mailing list Devel

[Devel] Re: [PATCH 6/7] user namespaces: convert all capable checks in kernel/sys.c

2011-01-10 Thread Serge E. Hallyn
Quoting Bastian Blank (bast...@waldi.eu.org): On Mon, Jan 10, 2011 at 09:14:07PM +, Serge E. Hallyn wrote: - if (pcred-uid != cred-euid - pcred-euid != cred-euid !capable(CAP_SYS_NICE)) { + if (pcred-user-user_ns != cred-user-user_ns + pcred-uid != cred-euid

[Devel] userns: targeted capabilities v4

2011-01-10 Thread Serge E. Hallyn
assigns a userns to a superblock (and hence to inodes), and grants 'user other' permissions to any task whose uid does not map to the target userns. (By default, this will be all but the initial userns) thanks, -serge ___ Containers mailing list contain

[Devel] [PATCH 01/08] Add a user_namespace as creator/owner of uts_namespace

2011-01-10 Thread Serge E. Hallyn
it. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/utsname.h |3 +++ init/version.c |2 ++ kernel/nsproxy.c|3 +++ kernel/user.c |8 ++-- kernel/utsname.c|4 5 files changed, 18 insertions(+), 2 deletions(-) diff

[Devel] [PATCH 07/08] user namespaces: convert several capable() calls

2011-01-10 Thread Serge E. Hallyn
of sched_capable(). Jan 11: Use nsown_capable() as suggested by Bastian Blank. Jan 11: Clarify (hopefully) some logic in futex and sched.c Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- ipc/shm.c |2 +- ipc/util.c|5 +++-- kernel/futex.c

[Devel] [PATCH 02/08] security: Make capabilities relative to the user namespace.

2011-01-10 Thread Serge E. Hallyn
potential uid confusion issues left. I still need to handle getting all caps after creation but otherwise I think I have a good starter patch that achieves all of your goals. Changelog: 11/05/2010: [serge] add apparmor 12/14/2010: [serge] fix capabilities to created user namespaces

[Devel] [PATCH 03/08] allow sethostname in a container

2011-01-10 Thread Serge E. Hallyn
Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- kernel/sys.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 2745dcd..9b9b03b 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1171,7 +1171,7 @@ SYSCALL_DEFINE2(sethostname

[Devel] [PATCH 04/08] allow killing tasks in your own or child userns

2011-01-10 Thread Serge E. Hallyn
need cred/tcred in check_kill_permission. Jan 1: use const cred struct. Jan 11: Per Bastian Blank's advice, clean up kill_ok_by_cred(). Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com Reviewed-by: Eric W. Biederman ebied...@xmission.com --- kernel/signal.c | 30

[Devel] [PATCH 05/08] Allow ptrace from non-init user namespaces

2011-01-10 Thread Serge E. Hallyn
feedback by Eric: . Correct ptrace uid check . Rename may_ptrace_ns to ptrace_capable . Also fix the cap_ptrace checks. Jan 1: Use const cred struct Jan 11: use task_ns_capable() in place of ptrace_capable(). Signed-off-by: Serge E. Hallyn

[Devel] [PATCH 06/08] user namespaces: convert all capable checks in kernel/sys.c

2011-01-10 Thread Serge E. Hallyn
11: Fix logic errors in uid checks pointed out by Bastian. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- kernel/sys.c | 67 +++-- 1 files changed, 41 insertions(+), 26 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c

[Devel] [PATCH 08/08] userns: check user namespace for task-file uid equivalence checks

2011-01-10 Thread Serge E. Hallyn
Cheat for now and say all files belong to init_user_ns. Next step will be to let superblocks belong to a user_ns, and derive inode_userns(inode) from inode-i_sb-s_user_ns. Finally we'll introduce more flexible arrangements. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- fs

[Devel] Re: Containers and /proc/sys/vm/drop_caches

2011-01-07 Thread Serge Hallyn
Quoting Rob Landley (rland...@parallels.com): On 01/06/2011 03:43 PM, Matt Helsley wrote: On Wed, Jan 05, 2011 at 07:46:17PM +0530, Balbir Singh wrote: On Wed, Jan 5, 2011 at 7:31 PM, Serge Hallyn serge.hal...@canonical.com wrote: Quoting Daniel Lezcano (daniel.lezc...@free.fr): On 01

[Devel] Re: Containers and /proc/sys/vm/drop_caches

2011-01-05 Thread Serge Hallyn
Debian Squeeze kernel, which is based on 2.6.32.27. There is definitively a big work to do with /proc. Some files should be not accessible (/proc/sys/vm/drop_caches, /proc/sys/kernel/sysrq, ...) and some other should be virtualized (/proc/meminfo, /proc/cpuinfo, ...). Serge suggested

[Devel] Re: Mapping PIDs from parent-child namespaces

2011-01-04 Thread Serge Hallyn
Quoting Mike Heffner (mi...@fesnel.com): On 01/04/2011 11:44 AM, Cedric Le Goater wrote: we use the following patch to get the pid of a task as seen from its pid namespace. It can be useful to identify tasks writing pids in files. Great, I'll try it out. Has there been any interest in

[Devel] Re: [RFC 4/5] user namespaces: allow killing tasks in your own or child userns

2011-01-02 Thread Serge E. Hallyn
, will have that fix) thanks, -serge ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ___ Devel mailing list Devel@openvz.org https

[Devel] Re: [RFC 4/5] user namespaces: allow killing tasks in your own or child userns

2010-12-31 Thread Serge E. Hallyn
Quoting Eric W. Biederman (ebied...@xmission.com): Serge E. Hallyn se...@hallyn.com writes: Quoting Eric W. Biederman (ebied...@xmission.com): --- a/kernel/signal.c +++ b/kernel/signal.c @@ -659,11 +686,7 @@ static int check_kill_permission(int sig, struct siginfo *info

[Devel] Re: [RFC 5/5] user namespaces: Allow ptrace from non-init user namespaces

2010-12-31 Thread Serge E. Hallyn
Quoting Eric W. Biederman (ebied...@xmission.com): Serge E. Hallyn se...@hallyn.com writes: ptrace is allowed to tasks in the same user namespace according to the usual rules (i.e. the same rules as for two tasks in the init user namespace). ptrace is also allowed to a user namespace

[Devel] [RFC 0/5] user namespaces: start clamping down

2010-12-17 Thread Serge E. Hallyn
hostnames, kill tasks, and do ptrace. My near-term next goals will be to enable setuid and setgid, and to provide a way for the filesystem to be usable in child user namespaces. At the very least I'd like a fresh loopback or LVM mount and proc mounts to be supported. thanks, -serge

[Devel] [RFC 1/5] user namespaces: Add a user_namespace as creator/owner of uts_namespace

2010-12-17 Thread Serge E. Hallyn
it. Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- include/linux/utsname.h |3 +++ init/version.c |2 ++ kernel/nsproxy.c|3 +++ kernel/user.c |8 ++-- kernel/utsname.c|4 5 files changed, 18 insertions(+), 2 deletions(-) diff

[Devel] [RFC 2/5] user namespaces: make capabilities relative to the user namespace.

2010-12-17 Thread Serge E. Hallyn
potential uid confusion issues left. I still need to handle getting all caps after creation but otherwise I think I have a good starter patch that achieves all of your goals. Changelog: 11/05/2010: [serge] add apparmor 12/14/2010: [serge] fix capabilities to created user namespaces

[Devel] [RFC 3/5] user namespaces: allow sethostname in a container

2010-12-17 Thread Serge E. Hallyn
Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- kernel/sys.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 2745dcd..9b9b03b 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1171,7 +1171,7 @@ SYSCALL_DEFINE2(sethostname

[Devel] [RFC 4/5] user namespaces: allow killing tasks in your own or child userns

2010-12-17 Thread Serge E. Hallyn
Changelog: Dec 8: Fixed bug in my check_kill_permission pointed out by Eric Biederman. Dec 13: Apply Eric's suggestion to pass target task into kill_ok_by_cred() for clarity Signed-off-by: Serge E. Hallyn serge.hal...@canonical.com --- kernel

[Devel] [RFC 5/5] user namespaces: Allow ptrace from non-init user namespaces

2010-12-17 Thread Serge E. Hallyn
ptrace is allowed to tasks in the same user namespace according to the usual rules (i.e. the same rules as for two tasks in the init user namespace). ptrace is also allowed to a user namespace to which the current task the has CAP_SYS_PTRACE capability. Signed-off-by: Serge E. Hallyn serge.hal

[Devel] Re: [RFC 1/5] user namespaces: Add a user_namespace as creator/owner of uts_namespace

2010-12-17 Thread Serge Hallyn
Quoting Alexey Dobriyan (adobri...@gmail.com): On Fri, Dec 17, 2010 at 5:24 PM, Serge E. Hallyn se...@hallyn.com wrote: +/* + * userns count is 1 for root user, 1 for init_uts_ns, + * and 1 for... ? + */  struct user_namespace init_user_ns = {        .kref

[Devel] Re: [RFC 1/5] user namespaces: Add a user_namespace as creator/owner of uts_namespace

2010-12-17 Thread Serge Hallyn
Quoting Alexey Dobriyan (adobri...@gmail.com): On Fri, Dec 17, 2010 at 5:56 PM, Alexey Dobriyan adobri...@gmail.com wrote: On Fri, Dec 17, 2010 at 5:24 PM, Serge E. Hallyn se...@hallyn.com wrote: +/* + * userns count is 1 for root user, 1 for init_uts_ns, + * and 1

[Devel] Re: [RFC 1/5] user namespaces: Add a user_namespace as creator/owner of uts_namespace

2010-12-17 Thread Serge Hallyn
. thanks, -serge ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ___ Devel mailing list Devel@openvz.org https://openvz.org/mailman

[Devel] Re: [RFC 4/5] user namespaces: allow killing tasks in your own or child userns

2010-12-17 Thread Serge E. Hallyn
Quoting Eric W. Biederman (ebied...@xmission.com): --- a/kernel/signal.c +++ b/kernel/signal.c @@ -659,11 +686,7 @@ static int check_kill_permission(int sig, struct siginfo *info, cred = current_cred(); tcred = __task_cred(t); Nit pick you don't need to compute cred and

[Devel] Re: [RFC 5/5] user namespaces: Allow ptrace from non-init user namespaces

2010-12-17 Thread Serge Hallyn
Thanks for reviewing, Eric. Quoting Eric W. Biederman (ebied...@xmission.com): +static inline int may_ptrace_ns(struct task_struct *t) Can we name this ptrace_capable? Since you are only wrapping the capability check? With a name like may_ptrace_ns I imagine very different semantics.

[Devel] Re: [RFC 4/5] user namespaces: allow killing tasks in your own or child userns

2010-12-17 Thread Serge E. Hallyn
calculation in that case, right? I mean cred and tcred are only use in kill_ok_by_cred. So we can eliminate those two variables from check_kill_permission. D'oh. Should've looked at the original tree, not the context. Got it, thanks. -serge

  1   2   3   4   5   6   7   8   9   10   >