[PATCH v2 3/3] seccomp: test SECCOMP_USER_NOTIF_FLAG_CONTINUE

2019-09-20 Thread Christian Brauner
-by: Christian Brauner Cc: Kees Cook Cc: Andy Lutomirski Cc: Will Drewry Cc: Shuah Khan Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Martin KaFai Lau Cc: Song Liu Cc: Yonghong Song Cc: Tycho Andersen CC: Tyler Hicks Cc: sta...@vger.kernel.org Cc: linux-kselft...@vger.kernel.org Cc: net

[PATCH v2 0/3] seccomp: continue syscall from notifier

2019-09-20 Thread Christian Brauner
Thanks! Christian *** BLURB HERE *** Christian Brauner (3): seccomp: add SECCOMP_USER_NOTIF_FLAG_CONTINUE seccomp: avoid overflow in implicit constant conversion seccomp: test SECCOMP_USER_NOTIF_FLAG_CONTINUE include/uapi/linux/seccomp.h | 28 + kernel/seccomp.c

[PATCH v2 1/3] seccomp: add SECCOMP_USER_NOTIF_FLAG_CONTINUE

2019-09-20 Thread Christian Brauner
quot;) Co-developed-by: Kees Cook Signed-off-by: Kees Cook Signed-off-by: Christian Brauner Reviewed-by: Tycho Andersen Cc: Andy Lutomirski Cc: Will Drewry CC: Tyler Hicks --- /* v2 */ - Jann Horn : - mention that SECCOMP_USER_NOTIF_FLAG_CONTINUE can be used to override lower SE

Re: [PATCH v1 1/3] seccomp: add SECCOMP_USER_NOTIF_FLAG_CONTINUE

2019-09-19 Thread Christian Brauner
On Thu, Sep 19, 2019 at 09:37:06PM +0200, Jann Horn wrote: > On Thu, Sep 19, 2019 at 11:59 AM Christian Brauner > wrote: > > This allows the seccomp notifier to continue a syscall. > [...] > > Recently we landed seccomp support for SECCOMP_RET_USER_NOTIF (cf. [4]) > &

Re: [PATCH v1 3/3] seccomp: test SECCOMP_USER_NOTIF_FLAG_CONTINUE

2019-09-19 Thread Christian Brauner
On Thu, Sep 19, 2019 at 11:13:46AM -0600, shuah wrote: > On 9/19/19 3:59 AM, Christian Brauner wrote: > > Test whether a syscall can be performed after having been intercepted by > > the seccomp notifier. The test uses dup() and kcmp() since it allows us to > > nicely

[PATCH v1 0/3] seccomp: continue syscall from notifier

2019-09-19 Thread Christian Brauner
...@brauner.io [3]: https://linuxplumbersconf.org/event/4/contributions/560 Christian Brauner (3): seccomp: add SECCOMP_USER_NOTIF_FLAG_CONTINUE seccomp: avoid overflow in implicit constant conversion seccomp: test SECCOMP_USER_NOTIF_FLAG_CONTINUE include/uapi/linux/seccomp.h | 20

[PATCH v1 3/3] seccomp: test SECCOMP_USER_NOTIF_FLAG_CONTINUE

2019-09-19 Thread Christian Brauner
-by: Christian Brauner Cc: Kees Cook Cc: Andy Lutomirski Cc: Will Drewry Cc: Shuah Khan Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Martin KaFai Lau Cc: Song Liu Cc: Yonghong Song Cc: Tycho Andersen CC: Tyler Hicks Cc: sta...@vger.kernel.org Cc: linux-kselft...@vger.kernel.org Cc: net

[PATCH v1 1/3] seccomp: add SECCOMP_USER_NOTIF_FLAG_CONTINUE

2019-09-19 Thread Christian Brauner
quot;) Co-developed-by: Kees Cook Signed-off-by: Kees Cook Signed-off-by: Christian Brauner Reviewed-by: Tycho Andersen Cc: Andy Lutomirski Cc: Will Drewry CC: Tyler Hicks --- /* v1 */ - Kees Cook , Tycho Andersen : - s/SECCOMP_RET_USER_NOTIF_ALLOW/SECCOMP_USER_NOTIF_FLAG_CONTINUE/g - Kees

[PATCH v1 2/3] seccomp: avoid overflow in implicit constant conversion

2019-09-19 Thread Christian Brauner
^ seccomp_bpf.c:3572:15: note: in expansion of macro ‘USER_NOTIF_MAGIC’ resp.error = USER_NOTIF_MAGIC; ^~~~ Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace") Signed-off-by: Christian Brauner Reviewed-by: Tyler Hicks Cc:

Re: [PATCH 1/4] seccomp: add SECCOMP_RET_USER_NOTIF_ALLOW

2019-09-19 Thread Christian Brauner
On Wed, Sep 18, 2019 at 12:07:12PM -0600, Tycho Andersen wrote: > On Wed, Sep 18, 2019 at 10:30:00AM -0700, Kees Cook wrote: > > On Wed, Sep 18, 2019 at 10:48:30AM +0200, Christian Brauner wrote: > > > This allows the seccomp notifier to continue a syscall. A positive >

Re: [PATCH 1/4] seccomp: add SECCOMP_RET_USER_NOTIF_ALLOW

2019-09-19 Thread Christian Brauner
On Wed, Sep 18, 2019 at 10:30:00AM -0700, Kees Cook wrote: > On Wed, Sep 18, 2019 at 10:48:30AM +0200, Christian Brauner wrote: > > This allows the seccomp notifier to continue a syscall. A positive > > discussion about this feature was triggered by a post to the > > ksummit

[PATCH 3/4] seccomp: avoid overflow in implicit constant conversion

2019-09-18 Thread Christian Brauner
^ seccomp_bpf.c:3572:15: note: in expansion of macro ‘USER_NOTIF_MAGIC’ resp.error = USER_NOTIF_MAGIC; ^~~~ Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace") Signed-off-by: Christian Brauner Cc: Kees Cook Cc: Andy Luto

[PATCH 0/4] seccomp: continue syscall from notifier

2019-09-18 Thread Christian Brauner
/contributions/560 Christian Brauner (4): seccomp: add SECCOMP_RET_USER_NOTIF_ALLOW seccomp: add two missing ptrace ifdefines seccomp: avoid overflow in implicit constant conversion seccomp: test SECCOMP_RET_USER_NOTIF_ALLOW include/uapi/linux/seccomp.h | 2 + kernel

[PATCH 2/4] seccomp: add two missing ptrace ifdefines

2019-09-18 Thread Christian Brauner
‘__EXPECT’ __typeof__(_expected) __exp = (_expected); \ ^ seccomp_bpf.c:1792:2: note: in expansion of macro ‘EXPECT_EQ’ EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY ^ Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace") Signed-off-by:

[PATCH 4/4] seccomp: test SECCOMP_RET_USER_NOTIF_ALLOW

2019-09-18 Thread Christian Brauner
-by: Christian Brauner Cc: Kees Cook Cc: Andy Lutomirski Cc: Will Drewry Cc: Shuah Khan Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Martin KaFai Lau Cc: Song Liu Cc: Yonghong Song Cc: Tycho Andersen CC: Tyler Hicks Cc: Jann Horn Cc: sta...@vger.kernel.org Cc: linux-kselft...@vger.kernel.org Cc

[PATCH 1/4] seccomp: add SECCOMP_RET_USER_NOTIF_ALLOW

2019-09-18 Thread Christian Brauner
e") Signed-off-by: Christian Brauner Cc: Kees Cook Cc: Andy Lutomirski Cc: Will Drewry Cc: Tycho Andersen CC: Tyler Hicks Cc: Jann Horn --- include/uapi/linux/seccomp.h | 2 ++ kernel/seccomp.c | 24 2 files changed, 22 insertions(+), 4 deletions(-)

Re: [PATCH] sched: Add __ASSEMBLY__ guards around struct clone_args

2019-09-17 Thread Christian Brauner
On Tue, Sep 17, 2019 at 09:18:53AM +0200, Seth Forshee wrote: > The addition of struct clone_args to uapi/linux/sched.h is not > protected by __ASSEMBLY__ guards, causing a FTBFS for glibc on > RISC-V. Add the guards to fix this. > > Fixes: 7f192e3cd316 ("fork: add clone3") > Signed-off-by: Seth

Re: [PATCH v3 0/6] Update clone3 self-tests

2019-09-16 Thread Christian Brauner
On Wed, Sep 11, 2019 at 07:01:54PM +0100, Eugene Syromiatnikov wrote: > Hello. > > This patch set updates clone3 selftest in several aspects: > - adding checks for exit_signal invalid values handling; > - adding clone3 to selftests targets; > - enabling clone3 tests on all architectures; > -

Re: [PATCH v2 0/6] Update clone3 self-tests

2019-09-16 Thread Christian Brauner
On Mon, Sep 16, 2019 at 10:12:47AM +0200, Adrian Reber wrote: > On Mon, Sep 16, 2019 at 09:49:34AM +0200, Christian Brauner wrote: > > On Tue, Sep 10, 2019 at 07:01:30PM +0100, Eugene Syromiatnikov wrote: > > > Hello. > > > > > > This patch set update

Re: [PATCH v2 0/6] Update clone3 self-tests

2019-09-16 Thread Christian Brauner
On Tue, Sep 10, 2019 at 07:01:30PM +0100, Eugene Syromiatnikov wrote: > Hello. > > This patch set updates clone3 selftest in several aspects: > - adding checks for exit_signal invalid values handling; > - adding clone3 to selftests targets; > - enabling clone3 tests on all architectures; > -

Re: [PATCH v3] fork: check exit_signal passed in clone3() call

2019-09-13 Thread Christian Brauner
On Wed, Sep 11, 2019 at 06:45:40PM +0100, Eugene Syromiatnikov wrote: > Previously, higher 32 bits of exit_signal fields were lost when > copied to the kernel args structure (that uses int as a type for the > respective field). Moreover, as Oleg has noted[1], exit_signal is used > unchecked, so

Re: [PATCH v2] fork: check exit_signal passed in clone3() call

2019-09-13 Thread Christian Brauner
On Wed, Sep 11, 2019 at 03:52:36PM +0200, Christian Brauner wrote: > On Wed, Sep 11, 2019 at 06:48:52AM -0700, Andrew Morton wrote: > > On Tue, 10 Sep 2019 18:58:52 +0100 Eugene Syromiatnikov > > wrote: > > > > > Previously, higher 32 bits of exit_signal fiel

[GIT PULL] clone3 exit signal fix

2019-09-12 Thread Christian Brauner
Hi Linus, This is a rather urgent last-minute bugfix for clone3() that should go in before we release 5.3 with clone3(). clone3() did not verify that the exit_signal argument was set to a valid signal. This can be used to cause a crash by specifying a signal greater than NSIG. e.g. -1. The

Re: [PATCH v2] fork: check exit_signal passed in clone3() call

2019-09-11 Thread Christian Brauner
On Wed, Sep 11, 2019 at 04:20:48PM +0100, Eugene Syromiatnikov wrote: > On Wed, Sep 11, 2019 at 04:54:47PM +0200, Christian Brauner wrote: > > On Wed, Sep 11, 2019 at 03:32:13PM +0100, Eugene Syromiatnikov wrote: > > > On Wed, Sep 11, 2019 at 04:16:36PM +0200, Chris

Re: [PATCH v2] fork: check exit_signal passed in clone3() call

2019-09-11 Thread Christian Brauner
On Wed, Sep 11, 2019 at 03:32:13PM +0100, Eugene Syromiatnikov wrote: > On Wed, Sep 11, 2019 at 04:16:36PM +0200, Christian Brauner wrote: > > On Wed, Sep 11, 2019 at 03:52:36PM +0200, Christian Brauner wrote: > > > On Wed, Sep 11, 2019 at 06:48:52AM -0700, Andrew Morton w

Re: [PATCH v2] fork: check exit_signal passed in clone3() call

2019-09-11 Thread Christian Brauner
On Wed, Sep 11, 2019 at 03:52:36PM +0200, Christian Brauner wrote: > On Wed, Sep 11, 2019 at 06:48:52AM -0700, Andrew Morton wrote: > > On Tue, 10 Sep 2019 18:58:52 +0100 Eugene Syromiatnikov > > wrote: > > > > > Previously, higher 32 bits of exit_signal fiel

Re: [PATCH v2] fork: check exit_signal passed in clone3() call

2019-09-11 Thread Christian Brauner
On Wed, Sep 11, 2019 at 06:48:52AM -0700, Andrew Morton wrote: > On Tue, 10 Sep 2019 18:58:52 +0100 Eugene Syromiatnikov > wrote: > > > Previously, higher 32 bits of exit_signal fields were lost when > > copied to the kernel args structure (that uses int as a type for the > > respective field).

Re: [PATCH v2] fork: check exit_signal passed in clone3() call

2019-09-11 Thread Christian Brauner
with 5.3. So we should just try and have this picked up this week before the release. I'm going to send a pr for this today hopefully. (Sorry for the delay, conferencing makes it harder to reply to mail.) Reviewed-by: Christian Brauner > > Acked-by: Oleg Nesterov >

[GIT PULL v1] core process updates for v5.4

2019-09-10 Thread Christian Brauner
ocess-v5.4 ---- Christian Brauner (2): pidfd: add P_PIDFD to waitid() pidfd: add pidfd_wait tests Eric W. Biederman (1): waitid: Add support for waiting for the current process group Suren Baghdasaryan (2): tests: move common definitions and functions in

Re: [PATCH] fork: fail on non-zero higher 32 bits of args.exit_signal

2019-09-10 Thread Christian Brauner
On Tue, Sep 10, 2019 at 04:39:44PM +0200, Oleg Nesterov wrote: > On 09/10, Christian Brauner wrote: > > On Tue, Sep 10, 2019 at 03:10:48PM +0200, Christian Brauner wrote: > > > On Tue, Sep 10, 2019 at 03:09:35PM +0200, Christian Brauner wrote: > > > > On Tue, Sep 10,

Re: [PATCH] fork: fail on non-zero higher 32 bits of args.exit_signal

2019-09-10 Thread Christian Brauner
On Tue, Sep 10, 2019 at 03:10:48PM +0200, Christian Brauner wrote: > On Tue, Sep 10, 2019 at 03:09:35PM +0200, Christian Brauner wrote: > > On Tue, Sep 10, 2019 at 02:44:41PM +0200, Oleg Nesterov wrote: > > > On 09/10, Eugene Syromiatnikov wrote: > > > > > > &

Re: [PATCH] fork: fail on non-zero higher 32 bits of args.exit_signal

2019-09-10 Thread Christian Brauner
On Tue, Sep 10, 2019 at 03:09:35PM +0200, Christian Brauner wrote: > On Tue, Sep 10, 2019 at 02:44:41PM +0200, Oleg Nesterov wrote: > > On 09/10, Eugene Syromiatnikov wrote: > > > > > > --- a/kernel/fork.c > > > +++ b/kernel/fork.c > > &

Re: [PATCH] fork: fail on non-zero higher 32 bits of args.exit_signal

2019-09-10 Thread Christian Brauner
On Tue, Sep 10, 2019 at 02:44:41PM +0200, Oleg Nesterov wrote: > On 09/10, Eugene Syromiatnikov wrote: > > > > --- a/kernel/fork.c > > +++ b/kernel/fork.c > > @@ -2562,6 +2562,9 @@ noinline static int copy_clone_args_from_user(struct > > kernel_clone_args *kargs, > > if (copy_from_user(,

Re: pivot_root(".", ".") and the fchdir() dance

2019-09-10 Thread Christian Brauner
On Tue, Sep 10, 2019 at 12:27:27PM +0200, Michael Kerrisk (man-pages) wrote: > Hello Eric, > > On 9/10/19 1:40 AM, Eric W. Biederman wrote: > > [...] > > >>> I have just spotted this conversation and I expect if you are going > >>> to use this example it is probably good to document what is

Re: [PATCH v2 1/5] fs: Add support for an O_MAYEXEC flag on sys_open()

2019-09-06 Thread Christian Brauner
On Sat, Sep 07, 2019 at 03:07:39AM +1000, Aleksa Sarai wrote: > On 2019-09-06, Mickaël Salaün wrote: > > > > On 06/09/2019 17:56, Florian Weimer wrote: > > > Let's assume I want to add support for this to the glibc dynamic loader, > > > while still being able to run on older kernels. > > > > > >

Re: [PATCH v3 0/4] Add binder state and statistics to binderfs

2019-09-04 Thread Christian Brauner
On Wed, Sep 04, 2019 at 04:49:03PM +0200, Greg Kroah-Hartman wrote: > On Wed, Sep 04, 2019 at 10:20:32AM -0400, Joel Fernandes wrote: > > On September 4, 2019 7:19:35 AM EDT, Christian Brauner > > wrote: > > >On Tue, Sep 03, 2019 at 09:16:51AM -0700, Hridya Valsaraju

[GIT PULL] core process updates for v5.4

2019-09-04 Thread Christian Brauner
tests: add tests for clone3() Christian Brauner (2): pidfd: add P_PIDFD to waitid() pidfd: add pidfd_wait tests Eric W. Biederman (1): waitid: Add support for waiting for the current process group Suren Baghdasaryan (2): tests: move common definitions and functions in

Re: [PATCH v3 0/4] Add binder state and statistics to binderfs

2019-09-04 Thread Christian Brauner
/debug/binder/proc > /sys/kernel/debug/binder/state > /sys/kernel/debug/binder/stats > /sys/kernel/debug/binder/transaction_log > /sys/kernel/debug/binder/transactions Acked-by: Christian Brauner Btw, I think your counting is off-by-one. :) We usually count the initial send of a se

Re: [PATCH v3 2/2] binder: Validate the default binderfs device names.

2019-09-04 Thread Christian Brauner
On Wed, Sep 04, 2019 at 12:49:39PM +0200, Greg Kroah-Hartman wrote: > On Wed, Sep 04, 2019 at 12:44:32PM +0200, Christian Brauner wrote: > > On Wed, Sep 04, 2019 at 09:19:29AM +0200, Greg Kroah-Hartman wrote: > > > On Fri, Aug 09, 2019 at 11:41:12AM -0700, Hridya Valsaraju wro

[RESEND PATCH v3 0/2] Add default binderfs devices

2019-09-04 Thread Christian Brauner
Hey, This is a resend of Hridya's series to add default binderfs devices. No semantical changes were made. Only Joel's Acks were added by me. Binderfs was created to help provide private binder devices to containers in their own IPC namespace. Currently, every time a new binderfs instance is

[RESEND PATCH v3 1/2] binder: Add default binder devices through binderfs when configured

2019-09-04 Thread Christian Brauner
-developed-by: Christian Brauner Signed-off-by: Christian Brauner Signed-off-by: Hridya Valsaraju Reviewed-by: Joel Fernandes (Google) Link: https://lore.kernel.org/r/20190808222727.132744-2-hri...@google.com --- drivers/android/binder.c | 5 +++-- drivers/android/binder_internal.h | 2

[RESEND PATCH v3 2/2] binder: Validate the default binderfs device names.

2019-09-04 Thread Christian Brauner
From: Hridya Valsaraju Length of a binderfs device name cannot exceed BINDERFS_MAX_NAME. This patch adds a check in binderfs_init() to ensure the same for the default binder devices that will be created in every binderfs instance. Co-developed-by: Christian Brauner Signed-off-by: Christian

Re: [PATCH v3 2/2] binder: Validate the default binderfs device names.

2019-09-04 Thread Christian Brauner
On Wed, Sep 04, 2019 at 09:19:29AM +0200, Greg Kroah-Hartman wrote: > On Fri, Aug 09, 2019 at 11:41:12AM -0700, Hridya Valsaraju wrote: > > On Fri, Aug 9, 2019 at 11:14 AM Christian Brauner > > wrote: > > > > > > On Fri, Aug 09, 2019 at 04:55:08PM +0200, Greg Kr

Re: [PATCH] binder: Use kmem_cache for binder_thread

2019-08-30 Thread Christian Brauner
On Fri, Aug 30, 2019 at 08:38:51AM +0200, Greg KH wrote: > On Thu, Aug 29, 2019 at 05:27:22PM +0200, Christian Brauner wrote: > > On Thu, Aug 29, 2019 at 09:53:59AM -0400, Joel Fernandes wrote: > > > On Thu, Aug 29, 2019 at 08:42:29AM +0200, Greg KH wrote: > > > >

Re: [PATCH v2 4/4] binder: Add binder_proc logging to binderfs

2019-08-30 Thread Christian Brauner
this file when debugfs > is not mounted. > > Signed-off-by: Hridya Valsaraju Same as for the previous patch: Please keep my Acked-by if you don't change this patch when you send out a new version. Acked-by: Christian Brauner > --- > > Changes in v2: > - Consistent

Re: [PATCH v2 3/4] binder: Make transaction_log available in binderfs

2019-08-30 Thread Christian Brauner
f you don't change this patch in the next version, please just keep my: Acked-by: Christian Brauner when sending it out. :) > --- > > Changes in v2: > -Consistent variable naming accross functions as per Christian Brauner. > > drivers/android/binder.c

Re: [PATCH v2 2/4] binder: Add stats, state and transactions files

2019-08-30 Thread Christian Brauner
gt; /dev/binderfs/binder_logs/transactions > > This provides a way to access them even when debugfs is not mounted. > > Signed-off-by: Hridya Valsaraju Just two comments below. If you have addressed them you can add my: Acked-by: Christian Brauner > --- > > Changes

Re: [PATCH] binder: Use kmem_cache for binder_thread

2019-08-29 Thread Christian Brauner
On Thu, Aug 29, 2019 at 09:53:59AM -0400, Joel Fernandes wrote: > On Thu, Aug 29, 2019 at 08:42:29AM +0200, Greg KH wrote: > > On Thu, Aug 29, 2019 at 01:49:53PM +0800, Peikan Tsai wrote: > [snip] > > > The allocated size for each binder_thread is 512 bytes by kzalloc. > > > Because the size of

Re: [PATCH 4/4] binder: Add binder_proc logging to binderfs

2019-08-28 Thread Christian Brauner
this file when debugfs > is not mounted. > > Signed-off-by: Hridya Valsaraju I'm still wondering whether there's a nicer way to create those debuf files per-process without doing it in binder_open() but it has worked fine for a long time with debugfs. Also, one minor question below. Otherwis

Re: [PATCH 3/4] binder: Make transaction_log available in binderfs

2019-08-28 Thread Christian Brauner
tion of > these files will be as follows: > > /dev/binderfs/binder_logs/failed_transaction_log > /dev/binderfs/binder_logs/transaction_log > > This change provides an alternate option to access these files when > debugfs is not mounted. > > Signed-off-by: Hridya Valsaraj

Re: [PATCH 2/4] binder: Add stats, state and transactions files

2019-08-28 Thread Christian Brauner
On Tue, Aug 27, 2019 at 01:41:50PM -0700, Hridya Valsaraju wrote: > The following binder stat files currently live in debugfs. > > /sys/kernel/debug/binder/state > /sys/kernel/debug/binder/stats > /sys/kernel/debug/binder/transactions > > This patch makes these files available in a binderfs

Re: [PATCH 1/4] binder: add a mount option to show global stats

2019-08-28 Thread Christian Brauner
On Wed, Aug 28, 2019 at 11:22:37AM +0200, Greg Kroah-Hartman wrote: > On Tue, Aug 27, 2019 at 01:41:49PM -0700, Hridya Valsaraju wrote: > > Currently, all binder state and statistics live in debugfs. > > We need this information even when debugfs is not mounted. > > This patch adds the mount

Re: [PATCH v3 1/1] waitid: Add support for waiting for the current process group

2019-08-14 Thread Christian Brauner
On Wed, Aug 14, 2019 at 06:09:17PM +0200, Oleg Nesterov wrote: > On 08/14, Christian Brauner wrote: > > > > and a signal could come in between the system call that > > retrieved the process gorup and the call to waitid that changes the > ^ &

Re: [PATCH v3 1/1] waitid: Add support for waiting for the current process group

2019-08-14 Thread Christian Brauner
On Wed, Aug 14, 2019 at 12:55:01PM -0400, Rich Felker wrote: > On Wed, Aug 14, 2019 at 06:34:44PM +0200, Christian Brauner wrote: > > On Wed, Aug 14, 2019 at 06:15:17PM +0200, Christian Brauner wrote: > > > On Wed, Aug 14, 2019 at 06:09:17PM +0200, Oleg Nesterov wrote: > >

Re: [PATCH v3 1/1] waitid: Add support for waiting for the current process group

2019-08-14 Thread Christian Brauner
On Wed, Aug 14, 2019 at 06:15:17PM +0200, Christian Brauner wrote: > On Wed, Aug 14, 2019 at 06:09:17PM +0200, Oleg Nesterov wrote: > > On 08/14, Christian Brauner wrote: > > > > > > and a signal could come in between the system call that > > > retrieved the

Re: [PATCH v3 1/1] waitid: Add support for waiting for the current process group

2019-08-14 Thread Christian Brauner
On Wed, Aug 14, 2019 at 06:09:17PM +0200, Oleg Nesterov wrote: > On 08/14, Christian Brauner wrote: > > > > and a signal could come in between the system call that > > retrieved the process gorup and the call to waitid that changes the > ^ &

Re: [PATCH v3 0/1] waitid: process group enhancement

2019-08-14 Thread Christian Brauner
On Wed, Aug 14, 2019 at 11:58:22AM -0400, Rich Felker wrote: > On Wed, Aug 14, 2019 at 05:43:59PM +0200, Christian Brauner wrote: > > Hey everyone, > > > > This patch adds support for waiting on the current process group by > > specifying waitid(P_PGID, 0, ...) as di

[PATCH v3 0/1] waitid: process group enhancement

2019-08-14 Thread Christian Brauner
Hey everyone, This patch adds support for waiting on the current process group by specifying waitid(P_PGID, 0, ...) as discussed in [1]. The details why we need to do this are in the commit message of [PATCH 1/1] so I won't repeat them here. I've picked this up since the thread has gone stale

[PATCH v3 1/1] waitid: Add support for waiting for the current process group

2019-08-14 Thread Christian Brauner
uot; Signed-off-by: Christian Brauner Cc: "H. Peter Anvin" Cc: Arnd Bergmann Cc: Palmer Dabbelt Cc: Rich Felker Cc: Alistair Francis Cc: Zong Li Cc: Andrew Morton Cc: Oleg Nesterov Cc: Linus Torvalds Cc: Al Viro Cc: Florian Weimer Cc: Adhemerval Zanella Cc: GNU C Library

Re: [PATCH v2 1/1] waitid: Add support for waiting for the current process group

2019-08-14 Thread Christian Brauner
On Wed, Aug 14, 2019 at 05:27:12PM +0200, Oleg Nesterov wrote: > On 08/14, Christian Brauner wrote: > > > > On Wed, Aug 14, 2019 at 04:19:57PM +0200, Oleg Nesterov wrote: > > > On 08/14, Christian Brauner wrote: > > > > > > >

Re: [PATCH v2 1/1] waitid: Add support for waiting for the current process group

2019-08-14 Thread Christian Brauner
On Wed, Aug 14, 2019 at 04:19:57PM +0200, Oleg Nesterov wrote: > On 08/14, Christian Brauner wrote: > > > > +static struct pid *find_get_pgrp(pid_t nr) > > +{ > > + struct pid *pid; > > + > > + if (nr) > > + return find_get_pid(nr

[PATCH v2 0/1] waitid: process group enhancement

2019-08-14 Thread Christian Brauner
Hey everyone, This patch adds support for waiting on the current process group by specifying waitid(P_PGID, 0, ...) as discussed in [1]. The details why we need to do this are in the commit message of [PATCH 1/1] so I won't repeat them here. I've picked this up since the thread has gone stale

[PATCH v2 1/1] waitid: Add support for waiting for the current process group

2019-08-14 Thread Christian Brauner
uot; Signed-off-by: Christian Brauner Cc: "H. Peter Anvin" Cc: Arnd Bergmann Cc: Palmer Dabbelt Cc: Rich Felker Cc: Alistair Francis Cc: Zong Li Cc: Andrew Morton Cc: Oleg Nesterov Cc: Linus Torvalds Cc: Al Viro Cc: Florian Weimer Cc: Adhemerval Zanella Cc: GNU C Library

Re: [PATCH v1 1/1] waitid: Add support for waiting for the current process group

2019-08-14 Thread Christian Brauner
On Wed, Aug 14, 2019 at 02:50:12PM +0200, Oleg Nesterov wrote: > On 08/14, Christian Brauner wrote: > > > > On Wed, Aug 14, 2019 at 02:29:10PM +0200, Oleg Nesterov wrote: > > > On 08/14, christian.brau...@ubuntu.com wrote: > > > > > > > >

Re: [PATCH v1 1/1] waitid: Add support for waiting for the current process group

2019-08-14 Thread Christian Brauner
On Wed, Aug 14, 2019 at 02:29:10PM +0200, Oleg Nesterov wrote: > On 08/14, christian.brau...@ubuntu.com wrote: > > > > case P_PGID: > > type = PIDTYPE_PGID; > > - if (upid <= 0) > > + if (upid < 0) > > return -EINVAL; > > + > > + if

[PATCH v1 1/1] waitid: Add support for waiting for the current process group

2019-08-14 Thread christian . brauner
uot; Signed-off-by: Christian Brauner Cc: "H. Peter Anvin" Cc: Arnd Bergmann Cc: Palmer Dabbelt Cc: Rich Felker Cc: Alistair Francis Cc: Zong Li Cc: Andrew Morton Cc: Oleg Nesterov Cc: Linus Torvalds Cc: Al Viro Cc: Florian Weimer Cc: Adhemerval Zanella Cc: GNU C Library

[PATCH v1 0/1] waitid: process group enhancement

2019-08-14 Thread christian . brauner
From: Christian Brauner Hey everyone, This patch adds support for waiting on the current process group by specifying waitid(P_PGID, 0, ...) as discussed in [1]. The details why we need to do this are in the commit message of [PATCH 1/1] so I won't repeat them here. I've picked this up since

Re: [PATCH v6 1/2] fork: extend clone3() to support setting a PID

2019-08-14 Thread Christian Brauner
On Wed, Aug 14, 2019 at 09:50:03AM +, Pavel Emelianov wrote: > On 8/12/19 11:09 PM, Adrian Reber wrote: > > The main motivation to add set_tid to clone3() is CRIU. > > > > To restore a process with the same PID/TID CRIU currently uses > > /proc/sys/kernel/ns_last_pid. It writes the desired

Re: [PATCH v6 2/2] selftests: add tests for clone3()

2019-08-13 Thread Christian Brauner
On Tue, Aug 13, 2019 at 04:46:18PM +0200, Christian Brauner wrote: > On Mon, Aug 12, 2019 at 10:09:39PM +0200, Adrian Reber wrote: > > This tests clone3() with and without set_tid to see if all desired PIDs > > are working as expected. The test tries to clone3() with a set_t

Re: [PATCH v6 2/2] selftests: add tests for clone3()

2019-08-13 Thread Christian Brauner
On Mon, Aug 12, 2019 at 10:09:39PM +0200, Adrian Reber wrote: > This tests clone3() with and without set_tid to see if all desired PIDs > are working as expected. The test tries to clone3() with a set_tid of > -1, 1, pid_max, a PID which is already in use and an unused PID. The > same tests are

Re: [PATCH v6 1/2] fork: extend clone3() to support setting a PID

2019-08-13 Thread Christian Brauner
as long as the desired PID/TID is available). > > This clone3() extension places the same restrictions (CAP_SYS_ADMIN) > on clone3() with set_tid as they are currently in place for ns_last_pid. > > Signed-off-by: Adrian Reber I'm fine with this version. Oleg, how do you feel about it now? :)

Re: [PATCH v6 1/2] fork: extend clone3() to support setting a PID

2019-08-12 Thread Christian Brauner
On Mon, Aug 12, 2019 at 11:02:41PM +0200, Adrian Reber wrote: > On Mon, Aug 12, 2019 at 01:43:53PM -0700, Andrei Vagin wrote: > > On Mon, Aug 12, 2019 at 1:10 PM Adrian Reber wrote: > > > > > > The main motivation to add set_tid to clone3() is CRIU. > > > > > > To restore a process with the same

Re: [PATCH v5 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-12 Thread Christian Brauner
On Mon, Aug 12, 2019 at 06:57:34PM +0200, Oleg Nesterov wrote: > On 08/12, Christian Brauner wrote: > > On Mon, Aug 12, 2019 at 06:37:10PM +0200, Oleg Nesterov wrote: > > > On 08/11, Adrian Reber wrote: > > > > > > > > include/linux/pid.h| 2 +

Re: [PATCH v5 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-12 Thread Christian Brauner
On Mon, Aug 12, 2019 at 06:37:10PM +0200, Oleg Nesterov wrote: > On 08/11, Adrian Reber wrote: > > > > include/linux/pid.h| 2 +- > > include/linux/sched/task.h | 1 + > > include/uapi/linux/sched.h | 1 + > > kernel/fork.c | 22 -- > > kernel/pid.c

Re: [PATCH v5 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-12 Thread Christian Brauner
On August 11, 2019 10:33:26 PM GMT+02:00, Adrian Reber wrote: >The main motivation to add set_tid to clone3() is CRIU. > >To restore a process with the same PID/TID CRIU currently uses >/proc/sys/kernel/ns_last_pid. It writes the desired (PID - 1) to >ns_last_pid and then (quickly) does a

Re: [PATCH v5 2/2] selftests: add tests for clone3()

2019-08-11 Thread Christian Brauner
On August 11, 2019 1:33:27 PM PDT, Adrian Reber wrote: >This tests clone3() with and without set_tid to see if all desired PIDs >are working as expected. The test tries to clone3() with a set_tid of >-1, 1, pid_max, a PID which is already in use and an unused PID. The >same tests are also running

Re: [PATCH v4 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-11 Thread Christian Brauner
On Sun, Aug 11, 2019 at 08:51:48AM +0200, Christian Brauner wrote: > On Sat, Aug 10, 2019 at 07:59:18AM +0200, Adrian Reber wrote: > > On Sat, Aug 10, 2019 at 03:10:34AM +0200, Christian Brauner wrote: > > > On Thu, Aug 08, 2019 at 11:22:21PM +0200, Adrian Reber wrote: > >

Re: [PATCH v4 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-11 Thread Christian Brauner
On Sat, Aug 10, 2019 at 07:59:18AM +0200, Adrian Reber wrote: > On Sat, Aug 10, 2019 at 03:10:34AM +0200, Christian Brauner wrote: > > On Thu, Aug 08, 2019 at 11:22:21PM +0200, Adrian Reber wrote: > > > The main motivation to add set_tid to clone3() is CRIU. > > >

Re: [PATCH v4 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-09 Thread Christian Brauner
On Thu, Aug 08, 2019 at 11:22:21PM +0200, Adrian Reber wrote: > The main motivation to add set_tid to clone3() is CRIU. > > To restore a process with the same PID/TID CRIU currently uses > /proc/sys/kernel/ns_last_pid. It writes the desired (PID - 1) to > ns_last_pid and then (quickly) does a

Re: [PATCH v3 1/2] binder: Add default binder devices through binderfs when configured

2019-08-09 Thread Christian Brauner
On Fri, Aug 09, 2019 at 04:50:16PM +0200, Greg Kroah-Hartman wrote: > On Thu, Aug 08, 2019 at 03:27:25PM -0700, Hridya Valsaraju wrote: > > Currently, since each binderfs instance needs its own > > private binder devices, every time a binderfs instance is > > mounted, all the default binder

Re: [PATCH v3 2/2] binder: Validate the default binderfs device names.

2019-08-09 Thread Christian Brauner
or the default binder devices that will be created in every > > binderfs instance. > > > > Co-developed-by: Christian Brauner > > Signed-off-by: Christian Brauner > > Signed-off-by: Hridya Valsaraju > > --- > > drivers/android/binderfs.c | 12 +++

Re: [PATCH v3 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-07 Thread Christian Brauner
On Wed, Aug 07, 2019 at 05:48:29PM +0200, Oleg Nesterov wrote: > On 08/06, Adrian Reber wrote: > > > > @@ -2530,12 +2530,14 @@ noinline static int > > copy_clone_args_from_user(struct kernel_clone_args *kargs, > > struct clone_args __user *uargs, > >

Re: [PATCH v3 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-07 Thread Christian Brauner
On Wed, Aug 07, 2019 at 06:08:56PM +0200, Oleg Nesterov wrote: > On 08/06, Adrian Reber wrote: > > > > @@ -2573,6 +2575,14 @@ noinline static int copy_clone_args_from_user(struct > > kernel_clone_args *kargs, > > .tls= args.tls, > > }; > > > > + if (size ==

Re: [PATCH v3 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-07 Thread Christian Brauner
On Wed, Aug 07, 2019 at 04:26:10PM +0200, Oleg Nesterov wrote: > On 08/06, Adrian Reber wrote: > > > > +struct pid *alloc_pid(struct pid_namespace *ns, int set_tid) > > { > > struct pid *pid; > > enum pid_type type; > > @@ -186,12 +186,35 @@ struct pid *alloc_pid(struct pid_namespace *ns)

Re: [PATCH v3 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-07 Thread Christian Brauner
On Tue, Aug 06, 2019 at 09:15:50PM +0200, Adrian Reber wrote: > The main motivation to add set_tid to clone3() is CRIU. > > To restore a process with the same PID/TID CRIU currently uses > /proc/sys/kernel/ns_last_pid. It writes the desired (PID - 1) to > ns_last_pid and then (quickly) does a

Re: [PATCH v2 1/2] binder: Add default binder devices through binderfs when configured

2019-08-07 Thread Christian Brauner
On Wed, Aug 07, 2019 at 02:02:05PM +0300, Dan Carpenter wrote: > On Tue, Aug 06, 2019 at 11:40:05AM -0700, Hridya Valsaraju wrote: > > @@ -467,6 +466,9 @@ static int binderfs_fill_super(struct super_block *sb, > > void *data, int silent) > > int ret; > > struct binderfs_info *info; > >

Re: [PATCH] Add default binder devices through binderfs when configured

2019-08-02 Thread Christian Brauner
erfs instance instead of global devices being created by > > the binder driver. > > > > Co-developed-by: Christian Brauner > > Signed-off-by: Christian Brauner > > Signed-off-by: Hridya Valsaraju > > --- > > drivers/a

Re: [PATCH v2 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-02 Thread Christian Brauner
On Fri, Aug 02, 2019 at 03:46:11PM +0200, Oleg Nesterov wrote: > On 08/02, Oleg Nesterov wrote: > > > > So Adrian, sorry for confusion, I think your patch is fine. > > Yes... but do we really need the new CLONE_SET_TID ? > > set_tid == 0 has no effect, can't we simply check kargs->set_tid != 0 >

Re: [PATCH v2 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-02 Thread Christian Brauner
On Fri, Aug 02, 2019 at 03:30:01PM +0200, Oleg Nesterov wrote: > On 08/02, Christian Brauner wrote: > > > > On Wed, Jul 31, 2019 at 06:12:22PM +0200, Adrian Reber wrote: > > > The main motivation to add CLONE_SET_TID to clone3() is CRIU. > > > > > > To re

Re: [PATCH v2 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-02 Thread Christian Brauner
On Wed, Jul 31, 2019 at 06:12:22PM +0200, Adrian Reber wrote: > The main motivation to add CLONE_SET_TID to clone3() is CRIU. > > To restore a process with the same PID/TID CRIU currently uses > /proc/sys/kernel/ns_last_pid. It writes the desired (PID - 1) to > ns_last_pid and then (quickly) does

Re: [PATCH v2 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-08-02 Thread Christian Brauner
On Fri, Aug 02, 2019 at 02:47:38PM +0200, Oleg Nesterov wrote: > On 08/02, Adrian Reber wrote: > > > > On Wed, Jul 31, 2019 at 07:41:36PM +0200, Oleg Nesterov wrote: > > > But the main question is how it can really help if ns->level > 0, unlikely > > > CRIU will ever need to clone the process with

Re: [PATCH 07/12] tools headers UAPI: Sync sched.h with the kernel

2019-08-01 Thread Christian Brauner
ed.h' > diff -u tools/include/uapi/linux/sched.h include/uapi/linux/sched.h > > No changes in tools/ due to the above. > > Cc: Adrian Hunter > Cc: Christian Brauner > Cc: Jiri Olsa > Cc: Luis Cláudio Gonçalves > Cc: Namhyung Kim > Cc: Patrick Bellasi > Link: http

Re: [PATCH 01/12] tools include UAPI: Sync x86's syscalls_64.tbl and generic unistd.h to pick up clone3 and pidfd_open

2019-08-01 Thread Christian Brauner
1] = "fsconfig", > [432] = "fsmount", > [433] = "fspick", > + [434] = "pidfd_open", > + [435] = "clone3", >}; > -#define SYSCALLTBL_x86_64_MAX_ID 433 > +#define SYSCALLTBL_x86_64_

[GIT PULL] pidfd fixes

2019-07-30 Thread Christian Brauner
Christian Brauner (2): pidfd: remove obsolete comments from test exit: make setting exit_state consistent Joel Fernandes (Google) (1): pidfd: Add warning if exit_state is 0 during notification kernel/exit.c | 5 +++-- kernel

Re: [PATCH 1/2] fork: extend clone3() to support CLONE_SET_TID

2019-07-29 Thread Christian Brauner
On Mon, Jul 29, 2019 at 08:17:58PM +0100, Dmitry Safonov wrote: > On Mon, 29 Jul 2019 at 20:12, Dmitry Safonov <0x7f454...@gmail.com> wrote: > > > > On Mon, 29 Jul 2019 at 17:52, Adrian Reber wrote: > > [..] > > > --- a/include/uapi/linux/sched.h > > > +++ b/include/uapi/linux/sched.h > > > @@

Re: [PATCH v3 1/2] pidfd: add P_PIDFD to waitid()

2019-07-29 Thread Christian Brauner
On Mon, Jul 29, 2019 at 09:24:38AM -0700, Kees Cook wrote: > On Sun, Jul 28, 2019 at 12:22:29AM +0200, Christian Brauner wrote: > > diff --git a/kernel/exit.c b/kernel/exit.c > > index a75b6a7f458a..64bb6893a37d 100644 > > --- a/kernel/exit.c > > +++ b/kernel/exi

Re: [PATCH v3 2/2] pidfd: add pidfd_wait tests

2019-07-29 Thread Christian Brauner
On Mon, Jul 29, 2019 at 09:31:23AM -0700, Kees Cook wrote: > On Sun, Jul 28, 2019 at 12:22:30AM +0200, Christian Brauner wrote: > > Add tests for pidfd_wait() and CLONE_WAIT_PID: > > - test that waitid(P_PIDFD) can wait on a pidfd > > - test that waitid(P_PIDFD) can wait

Re: [PATCH] exit: make setting exit_state consistent

2019-07-29 Thread Christian Brauner
On Mon, Jul 29, 2019 at 06:27:57PM +0200, Christian Brauner wrote: > Since commit [1] we unconditionally set exit_state to EXIT_ZOMBIE before > calling into do_notify_parent(). This was done to eliminate a race when > querying exit_state in do_notify_pidfd(). > Back then we d

[PATCH] exit: make setting exit_state consistent

2019-07-29 Thread Christian Brauner
code more consistent. /* References */ [1]: b191d6491be6 ("pidfd: fix a poll race when setting exit_state") [2]: https://lore.kernel.org/lkml/CAHk-=wigcxGFR2szue4wavJtH5cYTTeNES=toubvgsmx0rz...@mail.gmail.com Signed-off-by: Christian Brauner Cc: Oleg Nesterov Cc: Linus Torvalds --- ker

Re: [PATCH v3 1/2] pidfd: add P_PIDFD to waitid()

2019-07-29 Thread Christian Brauner
On Mon, Jul 29, 2019 at 04:27:44PM +0200, Oleg Nesterov wrote: > On 07/28, Christian Brauner wrote: > > > > +static struct pid *pidfd_get_pid(unsigned int fd) > > +{ > > + struct fd f; > > + struct pid *pid; > > + > > + f = fdget(fd); > &

<    4   5   6   7   8   9   10   11   12   13   >