[PATCH 0/1] devpts: use dynamic_dname() to generate proc name

2017-08-16 Thread Christian Brauner
more, the dynamic_dname() method will only allow you to access the dentry itself and not a struct path which would contain the vfsmount information. In any case, here is my patch, when applied the fd returned by ioctl(fd, TIOCGPTPEER) will have the correct content ("/dev/pts/"): Christian Brauner (1): devpts: use dynamic_dname() to generate proc name fs/devpts/inode.c | 13 + 1 file changed, 13 insertions(+) -- 2.13.3

[PATCH 1/1] devpts: use dynamic_dname() to generate proc name

2017-08-16 Thread Christian Brauner
; although it should likely be "/mnt/" into their implementation of ptsname{_r}() and so wouldn't be affected by this change at all. Furthermore, mounting devpts somewhere other than "/dev/pts" (e.g. "/mnt") doesn't seem to work and from what I gather fro

Re: [PATCH 0/1] devpts: use dynamic_dname() to generate proc name

2017-08-16 Thread Christian Brauner
On Wed, Aug 16, 2017 at 11:48:48AM -0700, Linus Torvalds wrote: > On Wed, Aug 16, 2017 at 11:26 AM, Linus Torvalds > wrote: > > > > Hardcoding "/dev/pts/%d" is something that user space can already do. > > The kernel can and should do better. > > Put another way: there's no point in applying the

Re: [PATCH 0/1] devpts: use dynamic_dname() to generate proc name

2017-08-16 Thread Christian Brauner
On Wed, Aug 16, 2017 at 11:03 PM, Linus Torvalds wrote: > On Wed, Aug 16, 2017 at 1:30 PM, Linus Torvalds > wrote: >> >> I suspect the easiest fix is to just add a "mnt" argument to >> devpts_acquire(), It shouldn't be too painful. Let me try. > > Ok, here's a *very* lightly tested patch. It mig

Re: [PATCH 0/1] devpts: use dynamic_dname() to generate proc name

2017-08-16 Thread Christian Brauner
On Wed, Aug 16, 2017 at 11:55 PM, Linus Torvalds wrote: > On Wed, Aug 16, 2017 at 2:45 PM, Linus Torvalds > wrote: >> >> But it would be good to just test this in general too, and make sure I >> didn't screw up some reference count or something. The patch *looks* >> obviously correct, but ... > >

Re: [PATCH 0/1] devpts: use dynamic_dname() to generate proc name

2017-08-16 Thread Christian Brauner
On Wed, Aug 16, 2017 at 11:45 PM, Linus Torvalds wrote: > On Wed, Aug 16, 2017 at 2:37 PM, Christian Brauner > wrote: >>> And Christian, if you can beat on this, that would be good. >> >> Yes, I can pound on this nicely with liblxc. We have patch >> ( https://

[PATCH 2/2 v2] user namespaces: bump idmap limits to 340

2017-10-16 Thread Christian Brauner
< sizeof(fd) / sizeof(fd[0]); i++) close(fd[i]); if (ret < 0) exit(EXIT_FAILURE); for (k = 0; k < 1000; k++) { sum += times[k]; } printf("Mean time per file in nanoseconds: %" PRIu64 "\n"

[PATCH 1/2 v2] user namespace: use union in {g,u}idmap struct

2017-10-16 Thread Christian Brauner
This is preparation for bumping the {g,u}idmap limits for usernamespaces. Signed-off-by: Christian Brauner --- include/linux/user_namespace.h | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h

[PATCH 1/2 v3] user namespace: use union in {g,u}idmap struct

2017-10-16 Thread Christian Brauner
This is preparation for bumping the {g,u}idmap limits for usernamespaces. Signed-off-by: Christian Brauner --- Changelog 2017-10-16: * Trivial: fix email addresses in CC: lines --- include/linux/user_namespace.h | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff

[PATCH 2/2 v3] user namespaces: bump idmap limits to 340

2017-10-16 Thread Christian Brauner
< sizeof(fd) / sizeof(fd[0]); i++) close(fd[i]); if (ret < 0) exit(EXIT_FAILURE); for (k = 0; k < 1000; k++) { sum += times[k]; } printf("Mean time per file in nanoseconds: %" PRIu64 &qu

Re: [PATCH 1/2 v2] user namespace: use union in {g,u}idmap struct

2017-10-16 Thread Christian Brauner
Please disregard v2 - It messed up the email addresses for Serge and Eric. v3 with the correct email addresses is already sent out. On Mon, Oct 16, 2017 at 05:30:53PM +0200, Christian Brauner wrote: > This is preparation for bumping the {g,u}idmap limits for usernamespaces. > > Sign

Re: [PATCH 0/5] userns: bump idmap limits, fixes & tweaks

2017-11-01 Thread Christian Brauner
On Tue, Oct 31, 2017 at 06:46:32PM -0500, Eric W. Biederman wrote: > > Christian I have looked through your code and I have found one real > issue and of things I want to twak Cool, thanks for taking a close look Eric. > > The real issue is reading nr_extents multiple times when reading a map. >

Re: [PATCH 0/5] userns: bump idmap limits, fixes & tweaks

2017-11-01 Thread Christian Brauner
On Wed, Nov 01, 2017 at 06:15:53AM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Tue, Oct 31, 2017 at 06:46:32PM -0500, Eric W. Biederman wrote: > >> > >> Christian I have looked through your code and I have found one real > >

Re: [PATCH 3/5] userns: Don't read extents twice in m_start

2017-11-01 Thread Christian Brauner
On Wed, Nov 01, 2017 at 02:05:39PM +0100, Peter Zijlstra wrote: > On Wed, Nov 01, 2017 at 06:08:35AM -0500, Eric W. Biederman wrote: > > Nikolay Borisov writes: > > > > > On 1.11.2017 01:48, Eric W. Biederman wrote: > > >> > > >> This is important so reading /proc//{uid_map,gid_map,projid_map}

Re: [PATCH 3/5] userns: Don't read extents twice in m_start

2017-11-01 Thread Christian Brauner
On Wed, Nov 01, 2017 at 03:16:54PM +0100, Peter Zijlstra wrote: > On Wed, Nov 01, 2017 at 03:01:45PM +0100, Christian Brauner wrote: > > Tbf, this isn't solely Eric's fault. I'm to blame here too since I didn't > > document the already existing smb_rmb()

Re: [PATCH 3/5] userns: Don't read extents twice in m_start

2017-11-01 Thread Christian Brauner
On Wed, Nov 01, 2017 at 02:05:39PM +0100, Peter Zijlstra wrote: > On Wed, Nov 01, 2017 at 06:08:35AM -0500, Eric W. Biederman wrote: > > Nikolay Borisov writes: > > > > > On 1.11.2017 01:48, Eric W. Biederman wrote: > > >> > > >> This is important so reading /proc//{uid_map,gid_map,projid_map}

[PATCH 0/1] userns: Fix/clarify memory ordering

2017-11-02 Thread Christian Brauner
This is a version of the suggested memory barrier patch. I've made it to apply cleanly against Eric's for-next tree as discussed with Peter. Christian Christian Brauner (1): userns: Fix/clarify memory ordering kernel/user_namespace.c | 74 +++---

[PATCH 1/1] userns: Fix/clarify memory ordering

2017-11-02 Thread Christian Brauner
()/READ_ONCE()s. CC: Eric Biederman Cc: Linux Containers Reported-by: Nikolay Borisov Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Christian Brauner --- kernel/user_namespace.c | 74 +++-- 1 file changed, 47 insertions(+), 27 deletions(-) diff

[PATCH 1/2 v6] user namespace: use union in {g,u}idmap struct

2017-10-24 Thread Christian Brauner
members in order to please gcc <= 4.4. Signed-off-by: Christian Brauner --- Changelog 2017-10-24: * no changes Changelog 2017-10-19: * kernel/user.c: Use brackets around anonymous union when using designated initializers to initialize members. This is done to please gcc <= 4.4. --- --- include

[PATCH 2/2 v6] user namespaces: bump idmap limits to 340

2017-10-24 Thread Christian Brauner
", (time_in_mcs * 1000) / 100); times[k] = (time_in_mcs * 1000) / 100; } close_all: for (i = 0; i < sizeof(fd) / sizeof(fd[0]); i++) close(fd[i]); if (ret < 0) exit(EXIT_FAILURE); for (k

Re: [PATCH v3] cpuset: Enable cpuset controller in default hierarchy

2017-10-26 Thread Christian Brauner
On Thu, Oct 26, 2017 at 02:12:01PM -0400, Waiman Long wrote: > On 10/26/2017 10:39 AM, Tejun Heo wrote: > > Hello, Waiman. > > > > On Wed, Oct 25, 2017 at 11:50:34AM -0400, Waiman Long wrote: > >> Ping! Any comment on this patch? Fwiw, I just saw this patch today for some weird reason. > > Sorry

Re: [PATCH 1/2 v3] user namespace: use union in {g,u}idmap struct

2017-10-18 Thread Christian Brauner
stian, > > [auto build test ERROR on linus/master] > [also build test ERROR on v4.14-rc5 next-20171017] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Christia

Re: [PATCH 1/2 v3] user namespace: use union in {g,u}idmap struct

2017-10-19 Thread Christian Brauner
On Wed, Oct 18, 2017 at 07:48:14PM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > I'm not sure why the build is complaining about how the union is initialized > > here. This looks legitimate to me and I can't reproduce this locally with or > >

[PATCH 1/2 v4] user namespace: use union in {g,u}idmap struct

2017-10-19 Thread Christian Brauner
members in order to please gcc <= 4.4. Signed-off-by: Christian Brauner --- Changelog 2017-10-19: * kernel/user.c: Use brackets around anonymous union when using designated initializers to initialize members. This is done to please gcc <= 4.4. --- include/linux/user_namespace.

[PATCH 2/2 v4] user namespaces: bump idmap limits to 340

2017-10-19 Thread Christian Brauner
", (time_in_mcs * 1000) / 100); times[k] = (time_in_mcs * 1000) / 100; } close_all: for (i = 0; i < sizeof(fd) / sizeof(fd[0]); i++) close(fd[i]); if (ret < 0) exit(EXIT_FAILURE); for (k

Re: [RFC PATCH 0/4] file: export functions for binder module

2018-08-02 Thread Christian Brauner
On Mon, Jul 30, 2018 at 10:41:09PM +0100, Al Viro wrote: > On Mon, Jul 30, 2018 at 10:28:40PM +0200, Christian Brauner wrote: > > On Mon, Jul 30, 2018 at 01:19:47PM -0700, Matthew Wilcox wrote: > > > On Mon, Jul 30, 2018 at 10:12:24PM +0200, Christian Brauner wrote: > > &

Re: [PATCH v4 0/4] seccomp trap to userspace

2018-08-06 Thread Christian Brauner
On Mon, Aug 06, 2018 at 08:44:42PM -0600, Tycho Andersen wrote: > Hi all, > > Dinesh Subhraveti has claimed that some part of this series might be > patented. While he has not furnished me with anything to confirm this > claim, I'll put this series on hold. Hey man, Sorry to hear that your faced

Re: [PATCH v4 0/4] seccomp trap to userspace

2018-08-07 Thread Christian Brauner
On Mon, Aug 06, 2018 at 09:19:04PM -0700, Andy Lutomirski wrote: > On Mon, Aug 6, 2018 at 8:30 PM, Christian Brauner > wrote: > > On Mon, Aug 06, 2018 at 08:44:42PM -0600, Tycho Andersen wrote: > >> Hi all, > >> > >> Dinesh Subhraveti has claimed

Re: [PATCH v5 1/5] seccomp: add a return code to trap to userspace

2018-08-29 Thread Christian Brauner
gt; * add signalled field to struct seccomp_notif (Jann) > * switch to using ioctls instead of read()/write() for struct passing > (Jann) > * add an ioctl to ensure an id is still valid > > Signed-off-by: Tycho Andersen > CC: Kees Cook > CC: Andy Lutomi

Re: [PATCH v5 2/5] seccomp: make get_nth_filter available outside of CHECKPOINT_RESTORE

2018-08-29 Thread Christian Brauner
v3: no changes > v4: no changes > v5: switch to CHECKPOINT_RESTORE || USER_NOTIFICATION to avoid warning when > only CONFIG_SECCOMP_FILTER is enabled. > > Signed-off-by: Tycho Andersen > CC: Kees Cook > CC: Andy Lutomirski > CC: Oleg Nesterov > CC: Eric W. Biederman

[PATCH v1] security/capabilities: remove check for -EINVAL

2018-08-22 Thread Christian Brauner
bprm_caps_from_vfs_caps() never returned -EINVAL so remove the rc == -EINVAL check. Signed-off-by: Christian Brauner --- v0 -> v1 - non-functional changes: adapt commit message to reflect the fact that bprm_caps_from_vfs_caps() never actuall returned -EINVAL. --- security/commoncap.c

[PATCH 1/4] file: export __alloc_fd()

2018-07-30 Thread Christian Brauner
The Android binder driver will be turned into a module. Since it uses __alloc_fd() we need to export this function. Signed-off-by: Christian Brauner Cc: Todd Kjos Cc: Robert Love Cc: Ben Hutching Cc: Martijn Coenen Cc: Arve Hjønnevåg --- fs/file.c | 1 + 1 file changed, 1 insertion

[PATCH 4/4] file: export put_files_struct()

2018-07-30 Thread Christian Brauner
The Android binder driver will be turned into a module. Since it uses put_files_struct() we need to export this function. Signed-off-by: Christian Brauner Cc: Todd Kjos Cc: Robert Love Cc: Ben Hutching Cc: Martijn Coenen Cc: Arve Hjønnevåg --- fs/file.c | 1 + 1 file changed, 1 insertion

[RFC PATCH 0/4] file: export functions for binder module

2018-07-30 Thread Christian Brauner
binder seems like a reasonable user of these functions. I don't expect this patch to be mergeable but rather to kick-off a discussion if we can either simply export them as they are or how we can get supportable exports that allow access to struct files_struct. Thanks! Christian Christian Br

[PATCH 3/4] file: export get_files_struct()

2018-07-30 Thread Christian Brauner
The Android binder driver will be turned into a module. Since it uses get_files_struct() we need to export this function. Signed-off-by: Christian Brauner Cc: Todd Kjos Cc: Robert Love Cc: Ben Hutching Cc: Martijn Coenen Cc: Arve Hjønnevåg --- fs/file.c | 1 + 1 file changed, 1 insertion

[PATCH 2/4] file: export __fd_install()

2018-07-30 Thread Christian Brauner
The Android binder driver will be turned into a module. Since it uses __fd_install() we need to export this function. Signed-off-by: Christian Brauner Cc: Todd Kjos Cc: Robert Love Cc: Ben Hutching Cc: Martijn Coenen Cc: Arve Hjønnevåg --- fs/file.c | 1 + 1 file changed, 1 insertion

Re: [RFC PATCH 0/4] file: export functions for binder module

2018-07-30 Thread Christian Brauner
On Mon, Jul 30, 2018 at 09:34:52AM -0700, Christoph Hellwig wrote: > On Mon, Jul 30, 2018 at 04:37:06PM +0200, Christian Brauner wrote: > > Hey, > > > > We currently plan on turning the Android binder and ashmem driver into a > > module. We have seen more and more requ

Re: [RFC PATCH 0/4] file: export functions for binder module

2018-07-30 Thread Christian Brauner
On Mon, Jul 30, 2018 at 01:19:47PM -0700, Matthew Wilcox wrote: > On Mon, Jul 30, 2018 at 10:12:24PM +0200, Christian Brauner wrote: > > > I don't expect this patch to be mergeable but rather to kick-off a > > > discussion if we can either simply export them as they a

Re: [PATCH 0/6 v1 resend] statfs: handle mount propagation

2018-07-19 Thread Christian Brauner
On Wed, Jun 13, 2018 at 05:07:02PM +0200, Christian Brauner wrote: > On Wed, Jun 13, 2018 at 04:24:54PM +0200, Greg KH wrote: > > On Wed, Jun 13, 2018 at 04:06:25PM +0200, Christian Brauner wrote: > > > On Fri, May 25, 2018 at 02:48:19PM +0200, Christian Brauner wrote: >

Re: [PATCH 1/4] file: export __alloc_fd()

2018-07-31 Thread Christian Brauner
On Tue, Jul 31, 2018 at 10:44:33AM +0200, Martijn Coenen wrote: > On Mon, Jul 30, 2018 at 10:36 PM, Matthew Wilcox wrote: > > I'm not entirely sure I understand the binder code (... does anyone?) > > but from what I can see, it intends to open a file descriptor in the > > process which is the targ

Re: [PATCH 1/1] getxattr: use correct xattr length

2018-07-23 Thread Christian Brauner
On Wed, Jun 13, 2018 at 10:45:37AM -0500, Serge Hallyn wrote: > On Thu, Jun 07, 2018 at 01:43:48PM +0200, Christian Brauner wrote: > > When running in a container with a user namespace, if you call getxattr > > with name = "system.posix_acl_access" and size % 8 != 4, t

[PATCH net-next 0/3] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK

2018-01-24 Thread Christian Brauner
Hi, Based on the previous discussion this enables passing a IFLA_IF_NETNSID property along with RTM_SETLINK and RTM_DELLINK requests. The patch for RTM_NEWLINK will be sent out in a separate patch since there are more corner-cases to think about. Best, Christian Christian Brauner (3

[PATCH net-next 1/3] rtnetlink: enable IFLA_IF_NETNSID in do_setlink()

2018-01-24 Thread Christian Brauner
retrieval for RTM_* requests that already support IFLA_NET_NS_{FD,PID} but get extended to IFLA_IF_NETNSID. To perserve backwards compatibility the helpers look for IFLA_NET_NS_{FD,PID} properties first before checking for IFLA_IF_NETNSID. Signed-off-by: Christian Brauner --- net/core/rtnetlink.c

[PATCH net-next 2/3] rtnetlink: enable IFLA_IF_NETNSID for RTM_SETLINK

2018-01-24 Thread Christian Brauner
: Christian Brauner --- net/core/rtnetlink.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 54134187485b..a4d4409685e3 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -2546,9 +2546,6 @@ static int rtnl_setlink(struct sk_buff

[PATCH net-next 3/3] rtnetlink: enable IFLA_IF_NETNSID for RTM_DELLINK

2018-01-24 Thread Christian Brauner
. Userpace should then fallback to other means. - Security: Callers must have CAP_NET_ADMIN in the owning user namespace of the target network namespace. Signed-off-by: Christian Brauner --- net/core/rtnetlink.c | 40 +--- 1 file changed, 29 insertions(+), 11

[PATCH net-next 3/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_DELLINK

2018-01-24 Thread Christian Brauner
. Userpace should then fallback to other means. - Security: Callers must have CAP_NET_ADMIN in the owning user namespace of the target network namespace. Signed-off-by: Christian Brauner --- Changelog 2018-01-24: * Preserve old behavior and report -ENODEV when either ifindex or ifname is provided

[PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK

2018-01-24 Thread Christian Brauner
old behavior and report -ENODEV when either ifindex or ifname is provided and IFLA_GROUP is set. Spotted by Wolfgang Bumiller. Christian Brauner (3): rtnetlink: enable IFLA_IF_NETNSID in do_setlink() rtnetlink: enable IFLA_IF_NETNSID for RTM_SETLINK rtnetlink: enable IFLA_IF_NETNSID for

[PATCH net-next 2/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_SETLINK

2018-01-24 Thread Christian Brauner
: Christian Brauner --- net/core/rtnetlink.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 54134187485b..a4d4409685e3 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -2546,9 +2546,6 @@ static int rtnl_setlink(struct sk_buff

[PATCH net-next 1/3 V1] rtnetlink: enable IFLA_IF_NETNSID in do_setlink()

2018-01-24 Thread Christian Brauner
retrieval for RTM_* requests that already support IFLA_NET_NS_{FD,PID} but get extended to IFLA_IF_NETNSID. To perserve backwards compatibility the helpers look for IFLA_NET_NS_{FD,PID} properties first before checking for IFLA_IF_NETNSID. Signed-off-by: Christian Brauner --- net/core/rtnetlink.c

Re: [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK

2018-01-25 Thread Christian Brauner
On Wed, Jan 24, 2018 at 03:26:31PM +0100, Christian Brauner wrote: > Hi, > > Based on the previous discussion this enables passing a IFLA_IF_NETNSID > property along with RTM_SETLINK and RTM_DELLINK requests. The patch for > RTM_NEWLINK will be sent out in a separate patch since

Re: [PATCH net-next 1/1] rtnetlink: enable IFLA_IF_NETNSID for RTM_NEWLINK

2018-01-30 Thread Christian Brauner
On Wed, Jan 31, 2018 at 12:13:11AM +0800, kbuild test robot wrote: > Hi Christian, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on net-next/master] > > url: > https://github.com/0day-ci/linux/commits/Christian-Brauner/rtnetlin

Re: [PATCH net-next 1/1] rtnetlink: enable IFLA_IF_NETNSID for RTM_NEWLINK

2018-01-31 Thread Christian Brauner
On Wed, Jan 31, 2018 at 10:30:44AM -0500, David Miller wrote: > From: Christian Brauner > Date: Mon, 29 Jan 2018 18:07:20 +0100 > > > - Backwards Compatibility: > > If userspace wants to determine whether RTM_NEWLINK supports the > > IFLA_IF_NETNSID propert

Re: [tip:x86/pti] x86/speculation: Use Indirect Branch Prediction Barrier in context switch

2018-02-01 Thread Christian Brauner
On Wed, Jan 31, 2018 at 08:03:00AM +0100, Dominik Brodowski wrote: > On Tue, Jan 30, 2018 at 02:39:45PM -0800, tip-bot for Tim Chen wrote: > > Commit-ID: 18bf3c3ea8ece8f03b6fc58508f2dfd23c7711c7 > > Gitweb: > > https://git.kernel.org/tip/18bf3c3ea8ece8f03b6fc58508f2dfd23c7711c7 > > Author:

[PATCH net] rtnetlink: remove check for IFLA_IF_NETNSID

2018-02-01 Thread Christian Brauner
RTM_NEWLINK supports the IFLA_IF_NETNSID property since 5bb8ed075428b71492734af66230aa0c07fcc515 so we should not error out when it is passed. Signed-off-by: Christian Brauner --- net/core/rtnetlink.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/core/rtnetlink.c b/net/core

[PATCH net-next 0/1] rtnetlink: request RTM_GETLINK by pid or fd

2018-01-18 Thread Christian Brauner
o if I missed a very obvious point why this wasn't possible so far, I'm sorry. Christian Christian Brauner (1): rtnetlink: request RTM_GETLINK by pid or fd net/core/rtnetlink.c | 63 +--- 1 file changed, 50 insertions(+), 13 deletions(-) -- 2.14.1

[PATCH net-next 1/1] rtnetlink: request RTM_GETLINK by pid or fd

2018-01-18 Thread Christian Brauner
userspace set the IFLA_NET_NS_{FD,PID} property to identify a target network namespace where the device in question is to be queried. Signed-off-by: Christian Brauner --- net/core/rtnetlink.c | 63 +--- 1 file changed, 50 insertions(+), 13 deletions

Re: [PATCH net-next 1/1] rtnetlink: request RTM_GETLINK by pid or fd

2018-01-18 Thread Christian Brauner
On Thu, Jan 18, 2018 at 09:29:14PM +0100, Jiri Benc wrote: > On Thu, 18 Jan 2018 21:21:24 +0100, Christian Brauner wrote: > > In such scenarios setting a netns id property is > > not really wanted > > Why? I think that's what you should do if you want to avoid setns. J

Re: [PATCH net-next 1/1] rtnetlink: request RTM_GETLINK by pid or fd

2018-01-22 Thread Christian Brauner
On Mon, Jan 22, 2018 at 10:00:46PM +0100, Jiri Benc wrote: > On Thu, 18 Jan 2018 21:55:53 +0100, Christian Brauner wrote: > > A more concrete scenario is creating a network namespace, moving a > > device into it via RTM_SETLINK which also supports IFLA_NET_NS_{FD,PID} > > and

Re: [PATCH net-next 1/1] rtnetlink: request RTM_GETLINK by pid or fd

2018-01-22 Thread Christian Brauner
On Mon, Jan 22, 2018 at 11:06:16PM +0100, Jiri Benc wrote: > On Mon, 22 Jan 2018 22:23:54 +0100, Christian Brauner wrote: > > That is certainly a good idea and I'm happy to send a follow-up patch > > for that! > > Note that I haven't looked into that and I do

[PATCH net-next 1/1] rtnetlink: enable IFLA_IF_NETNSID for RTM_NEWLINK

2018-01-29 Thread Christian Brauner
. Userpace should then fallback to other means. - Security: Callers must have CAP_NET_ADMIN in the owning user namespace of the target network namespace. Signed-off-by: Christian Brauner --- net/core/rtnetlink.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/net/core

[PATCH net-next 0/1] rtnetlink: enable IFLA_IF_NETNSID for RTM_NEWLINK

2018-01-29 Thread Christian Brauner
Hi, Based on the previous discussion this enables passing a IFLA_IF_NETNSID property along with RTM_NEWLINK requests. The latter patch was missing from my previous series to allow for some more time to test this. Best, Christian Christian Brauner (1): rtnetlink: enable IFLA_IF_NETNSID for

Re: [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK

2018-01-29 Thread Christian Brauner
On Mon, Jan 29, 2018 at 11:31:57AM -0500, David Miller wrote: > From: Christian Brauner > Date: Wed, 24 Jan 2018 15:26:31 +0100 > > > Based on the previous discussion this enables passing a IFLA_IF_NETNSID > > property along with RTM_SETLINK and RTM_DELLINK re

Re: [PATCH v1] devpts: resolve devpts bind-mounts

2018-03-11 Thread Christian Brauner
On Fri, Mar 09, 2018 at 10:37:34AM -0800, Linus Torvalds wrote: > Hmm. This hunk annoys me and makes me go "Whaa?": > > On Fri, Mar 9, 2018 at 2:57 AM, Christian Brauner > wrote: > > @@ -163,6 +159,26 @@ struct vfsmount *devpts_mntget(struct file *filp,

[PATCH 1/3 v2] devpts: hoist out check for DEVPTS_SUPER_MAGIC

2018-03-11 Thread Christian Brauner
Hoist the check whether we have already found a suitable devpts filesystem out of devpts_ptmx_path() in preparation for the devpts bind-mount resolution patch. This is a non-functional change. Signed-off-by: Christian Brauner --- ChangeLog v1->v2: * patch added ChangeLog v0->v1: * pat

[PATCH 3/3 v2] selftests: add devpts selftests

2018-03-11 Thread Christian Brauner
This adds a simple test to check whether /proc//fd/ symlinks are correctly pointing to /dev/pts/ devices when attached to a terminal. Signed-off-by: Christian Brauner --- ChangeLog v1->v2: * patch added ChangeLog v0->v1: * patch not present --- tools/testing/selftests/Ma

[PATCH 0/3 v2] devpts: handle /dev/ptmx bind-mounts

2018-03-11 Thread Christian Brauner
es a libc that uses TIOCGPTPEER in its openpty() implementation: unshare --mount mount --bind /dev/pts/ptmx /dev/ptmx chmod 666 /dev/ptmx script ls -al /proc/self/fd/0 with output: lrwx-- 1 chb chb 64 Mar 7 16:41 /proc/self/fd/0 -> / Christian Brauner (3): devpts: hoist out check

[PATCH 2/3 v2] devpts: resolve devpts bind-mounts

2018-03-11 Thread Christian Brauner
pts/ptmx /dev/ptmx chmod 666 /dev/ptmx script ls -al /proc/self/fd/0 with output: lrwx-- 1 chb chb 64 Mar 7 16:41 /proc/self/fd/0 -> / Signed-off-by: Christian Brauner Suggested-by: Eric Biederman Suggested-by: Linus Torvalds --- ChangeLog v1->v2: * move removal of if (path->m

Re: [PATCH 0/3 v2] devpts: handle /dev/ptmx bind-mounts

2018-03-12 Thread Christian Brauner
On Sun, Mar 11, 2018 at 02:46:26PM -0700, Linus Torvalds wrote: > On Sun, Mar 11, 2018 at 2:05 PM, Christian Brauner > wrote: > > > > This is the second iteration of this patch. > > This looks good to me. Just wondering how this should be merged, and > whether we shou

[PATCH 3/3 v3] selftests: add devpts selftests

2018-03-12 Thread Christian Brauner
This adds a simple test to check whether /proc//fd/ symlinks are correctly pointing to /dev/pts/ devices when attached to a terminal. Signed-off-by: Christian Brauner --- ChangeLog v2->v3: * extend test for non-standard devpts mounts such as mount -t devpts e devpts /mnt ChangeLog v1-

[PATCH 1/3 v3] devpts: hoist out check for DEVPTS_SUPER_MAGIC

2018-03-12 Thread Christian Brauner
Hoist the check whether we have already found a suitable devpts filesystem out of devpts_ptmx_path() in preparation for the devpts bind-mount resolution patch. This is a non-functional change. Signed-off-by: Christian Brauner --- ChangeLog v2->v3: * patch unchanged ChangeLog v1->v2: *

[PATCH 2/3 v3] devpts: resolve devpts bind-mounts

2018-03-12 Thread Christian Brauner
ty() implementation: unshare --mount mount --bind /dev/pts/ptmx /dev/ptmx chmod 666 /dev/ptmx script ls -al /proc/self/fd/0 with output: lrwx-- 1 chb chb 64 Mar 7 16:41 /proc/self/fd/0 -> / Signed-off-by: Christian Brauner Suggested-by: Eric Biederman Suggested-by: Linus Torvalds --

[PATCH 0/3 v3] devpts: handle bind-mounts

2018-03-12 Thread Christian Brauner
account for this. Here's a little reproducer that presupposes a libc that uses TIOCGPTPEER in its openpty() implementation: unshare --mount mount --bind /dev/pts/ptmx /dev/ptmx chmod 666 /dev/ptmx script ls -al /proc/self/fd/0 with output: lrwx-- 1 chb chb 64 Mar 7 16:41 /proc/self/fd/

Re: [PATCH 2/3 v3] devpts: resolve devpts bind-mounts

2018-03-12 Thread Christian Brauner
On Mon, Mar 12, 2018 at 02:52:53PM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > Most libcs will still look at /dev/ptmx when opening the master fd of a pty > > device. When /dev/ptmx is a bind-mount of /dev/pts/ptmx and the TIOCGPTPEER > > ioctl() is

[PATCH 0/3 v4] devpts: handle bind-mounts

2018-03-12 Thread Christian Brauner
bc that uses TIOCGPTPEER in its openpty() implementation: unshare --mount mount --bind /dev/pts/ptmx /dev/ptmx chmod 666 /dev/ptmx script ls -al /proc/self/fd/0 with output: lrwx-- 1 chb chb 64 Mar 7 16:41 /proc/self/fd/0 -> / Christian Brauner (3): devpts: hoist out check for DEVPTS_S

[PATCH 3/3 v4] selftests: add devpts selftests

2018-03-12 Thread Christian Brauner
This adds tests to check: - bind-mounts from /dev/pts/ptmx to /dev/ptmx work - non-standard mounts of devpts work - bind-mounts of /dev/pts/ptmx to locations that do not resolve to a valid slave pty path under the originating devpts mount fail Signed-off-by: Christian Brauner --- ChangeLog v3

[PATCH 2/3 v4] devpts: resolve devpts bind-mounts

2018-03-12 Thread Christian Brauner
ty() implementation: unshare --mount mount --bind /dev/pts/ptmx /dev/ptmx chmod 666 /dev/ptmx script ls -al /proc/self/fd/0 with output: lrwx-- 1 chb chb 64 Mar 7 16:41 /proc/self/fd/0 -> / Signed-off-by: Christian Brauner Suggested-by: Eric Biederman Suggested-by: Linus Torvalds --- C

[PATCH 1/3 v4] devpts: hoist out check for DEVPTS_SUPER_MAGIC

2018-03-12 Thread Christian Brauner
Hoist the check whether we have already found a suitable devpts filesystem out of devpts_ptmx_path() in preparation for the devpts bind-mount resolution patch. This is a non-functional change. Signed-off-by: Christian Brauner --- ChangeLog v3->v4: * patch unchanged ChangeLog v2->v3: *

Invalid /proc//fd/{0,1,2} symlinks with TIOCGPTPEER

2018-03-07 Thread Christian Brauner
Hey, We discovered a potential bug in the devpts implementation via TIOCGPTPEER ioctl()s today. We've tackled a similar problem already in: commit 311fc65c9fb9c966bca8e6f3ff8132ce57344ab9 Author: Eric W. Biederman Date: Thu Aug 24 15:13:29 2017 -0500 pty: Repair TIOCGPTPEER Most libcs wi

Re: [PATCH 0/3 RESEND] namei: add follow_up_bind()

2018-04-06 Thread Christian Brauner
On Thu, Apr 05, 2018 at 07:45:15PM +0200, Christian Brauner wrote: > On Thu, Apr 05, 2018 at 09:28:56AM -0700, Linus Torvalds wrote: > > On Thu, Apr 5, 2018 at 3:51 AM, Christian Brauner > > wrote: > > > > > > This series adds: > > > - follow_up_bind

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-06 Thread Christian Brauner
On Thu, Apr 05, 2018 at 10:59:49PM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Thu, Apr 05, 2018 at 05:26:59PM +0300, Kirill Tkhai wrote: > >> On 05.04.2018 17:07, Christian Brauner wrote: > >> > On Thu, Apr 05, 2018 at 04:01:03PM +030

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-06 Thread Christian Brauner
On Fri, Apr 06, 2018 at 09:45:41AM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Thu, Apr 05, 2018 at 10:59:49PM -0500, Eric W. Biederman wrote: > >> Christian Brauner writes: > >> > >> > On Thu, Apr 05, 2018 at 05:26:59PM +0300,

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-11 Thread Christian Brauner
On Tue, Apr 10, 2018 at 10:04:46AM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Mon, Apr 09, 2018 at 06:21:31PM -0500, Eric W. Biederman wrote: > >> Christian Brauner writes: > >> > >> > On Thu, Apr 05, 2018 at

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-11 Thread Christian Brauner
On Wed, Apr 11, 2018 at 11:40:14AM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Tue, Apr 10, 2018 at 10:04:46AM -0500, Eric W. Biederman wrote: > >> Christian Brauner writes: > >> > >> > On Mon, Apr 09, 2018 at

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-11 Thread Christian Brauner
On Wed, Apr 11, 2018 at 01:37:18PM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Wed, Apr 11, 2018 at 11:40:14AM -0500, Eric W. Biederman wrote: > >> Christian Brauner writes: > >> > Yeah, agreed. > >> > But I think the pa

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-11 Thread Christian Brauner
On Wed, Apr 11, 2018 at 02:16:23PM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Wed, Apr 11, 2018 at 01:37:18PM -0500, Eric W. Biederman wrote: > >> Christian Brauner writes: > >> > >> > On Wed, Apr 11, 2018 at

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-09 Thread Christian Brauner
On Thu, Apr 05, 2018 at 10:59:49PM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Thu, Apr 05, 2018 at 05:26:59PM +0300, Kirill Tkhai wrote: > >> On 05.04.2018 17:07, Christian Brauner wrote: > >> > On Thu, Apr 05, 2018 at 04:01:03PM +030

Re: [PATCH 4/4 v5 RESEND] selftests: add devpts selftests

2018-04-10 Thread Christian Brauner
On Tue, Apr 10, 2018 at 04:20:44PM +1000, Michael Ellerman wrote: > Hi Christian, > > Christian Brauner writes: > > diff --git a/tools/testing/selftests/Makefile > > b/tools/testing/selftests/Makefile > > index 7442dfb73b7f..dbda89c9d9b9 100644 > > --- a

Re: [PATCH 4/4 v5 RESEND] selftests: add devpts selftests

2018-04-10 Thread Christian Brauner
On Tue, Apr 10, 2018 at 07:34:36PM +1000, Michael Ellerman wrote: > Christian Brauner writes: > > On Tue, Apr 10, 2018 at 04:20:44PM +1000, Michael Ellerman wrote: > >> Christian Brauner writes: > >> > diff --git a/tools/testing/selftests/Makefile > >&g

Re: [PATCH] selftests/filesystems: Don't run dnotify_test by default

2018-04-10 Thread Christian Brauner
rule. > > Fixes: ce290a19609d ("selftests: add devpts selftests") > Signed-off-by: Michael Ellerman I'm not sure if I should've made it to be built given that it wasn't before but it probably doesn't hurt. It's either that or remove it I guess. Acked-by

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-10 Thread Christian Brauner
On Mon, Apr 09, 2018 at 06:21:31PM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Thu, Apr 05, 2018 at 10:59:49PM -0500, Eric W. Biederman wrote: > >> Christian Brauner writes: > >> > >> > On Thu, Apr 05, 2018 at 05:26:59PM +0300,

Re: Invalid /proc//fd/{0,1,2} symlinks with TIOCGPTPEER

2018-03-08 Thread Christian Brauner
On Wed, Mar 07, 2018 at 11:44:35AM -0800, Linus Torvalds wrote: > On Wed, Mar 7, 2018 at 8:17 AM, Christian Brauner > wrote: > > > > unshare --mount > > mount --bind /dev/pts/ptmx /dev/ptmx > > chmod 666 /dev/ptmx > > Oh. Why are you using a bind mount in th

Re: Invalid /proc//fd/{0,1,2} symlinks with TIOCGPTPEER

2018-03-08 Thread Christian Brauner
On Wed, Mar 07, 2018 at 01:30:52PM -0600, Eric W. Biederman wrote: > Christian Brauner writes: > > > Hey, > > > > We discovered a potential bug in the devpts implementation via > > TIOCGPTPEER ioctl()s today. We've tackled a similar

Re: Invalid /proc//fd/{0,1,2} symlinks with TIOCGPTPEER

2018-03-08 Thread Christian Brauner
On Thu, Mar 08, 2018 at 09:22:29AM +0100, Christian Brauner wrote: > On Wed, Mar 07, 2018 at 01:30:52PM -0600, Eric W. Biederman wrote: > > Christian Brauner writes: > > > > > Hey, > > > > > > We discovered a potential bug in the devpts implementation v

[PATCH] devpts: resolve devpts bind-mounts

2018-03-08 Thread Christian Brauner
supposes a libc that uses TIOCGPTPEER in its openpty() implementation: unshare --mount mount --bind /dev/pts/ptmx /dev/ptmx chmod 666 /dev/ptmx script ls -al /proc/self/fd/0 with output: lrwx-- 1 chb chb 64 Mar 7 16:41 /proc/self/fd/0 -> / Signed-off-by: Christian Brauner Sugge

[PATCH v1] devpts: resolve devpts bind-mounts

2018-03-09 Thread Christian Brauner
--- 1 chb chb 64 Mar 7 16:41 /proc/self/fd/0 -> / Signed-off-by: Christian Brauner Suggested-by: Eric Biederman Suggested-by: Linus Torvalds --- ChangeLog v0->v1: - remove /* Has the devpts filesystem already been found? */ if (path->mnt->mnt_sb->s_magic == DEV

[PATCH v1] devpts: resolve devpts bind-mounts

2018-03-09 Thread Christian Brauner
--- 1 chb chb 64 Mar 7 16:41 /proc/self/fd/0 -> / Signed-off-by: Christian Brauner Suggested-by: Eric Biederman Suggested-by: Linus Torvalds --- ChangeLog v0->v1: - remove /* Has the devpts filesystem already been found? */ if (path->mnt->mnt_sb->s_magic == DEV

[PATCH 0/4 v5] devpts: handle bind-mounts correctly

2018-03-13 Thread Christian Brauner
dev/pts/ptmx bind-mounts to /dev/ptmx and non-standard devpts mounts such as mount -t devpts devpts /mnt ChangeLog v1->v2: * see individual patches ChangeLog v0->v1: * see individual patches Christian Brauner (4): devpts: hoist out check for DEVPTS_SUPER_MAGIC devpts: resolve d

[PATCH 4/4 v5] selftests: add devpts selftests

2018-03-13 Thread Christian Brauner
This adds tests to check: - bind-mounts from /dev/pts/ptmx to /dev/ptmx work - non-standard mounts of devpts work - bind-mounts of /dev/pts/ptmx to locations that do not resolve to a valid slave pty path under the originating devpts mount fail Signed-off-by: Christian Brauner --- ChangeLog v4

[PATCH 2/4 v5] devpts: resolve devpts bind-mounts

2018-03-13 Thread Christian Brauner
ices located outside the devpts mount without a common ancestor directory: mount -t devpts devpts /dev/pts mount --bind /dev/pts/ptmx /ptmx master = open("/ptmx", ...); slave = ioctl(master, TIOCGPTPEER, ...); in which case save path generation cannot be guaranteed. Signed-off-by

[PATCH 1/4 v5] devpts: hoist out check for DEVPTS_SUPER_MAGIC

2018-03-13 Thread Christian Brauner
Hoist the check whether we have already found a suitable devpts filesystem out of devpts_ptmx_path() in preparation for the devpts bind-mount resolution patch. This is a non-functional change. Signed-off-by: Christian Brauner --- ChangeLog v4->v5: * dput() dentry ChangeLog v3->v4: *

  1   2   3   4   5   6   7   8   9   10   >