Re: [PATCH v2] taskstats: fix data-race

2019-10-07 Thread Christian Brauner
On Mon, Oct 07, 2019 at 03:50:47PM +0200, Dmitry Vyukov wrote: > On Mon, Oct 7, 2019 at 3:18 PM Andrea Parri wrote: > > > > On Mon, Oct 07, 2019 at 01:01:17PM +0200, Christian Brauner wrote: > > > When assiging and testing taskstats in taskstats_exit() there's

Re: [PATCH v2] taskstats: fix data-race

2019-10-07 Thread Christian Brauner
On Mon, Oct 07, 2019 at 04:08:41PM +0200, Dmitry Vyukov wrote: > On Mon, Oct 7, 2019 at 3:55 PM Christian Brauner > wrote: > > > > On Mon, Oct 07, 2019 at 03:50:47PM +0200, Dmitry Vyukov wrote: > > > On Mon, Oct 7, 2019 at 3:18 PM Andrea Parri > > > wrote:

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

2019-09-18 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

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

2019-09-18 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 > >

[PATCH v1 3/3] seccomp: test SECCOMP_USER_NOTIF_FLAG_CONTINUE

2019-09-19 Thread Christian Brauner
: 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
o userspace") 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_CON

[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:

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

2019-09-19 Thread Christian Brauner
r5ns3...@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

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

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]) > &

[PATCH v2 1/3] seccomp: add SECCOMP_USER_NOTIF_FLAG_CONTINUE

2019-09-20 Thread Christian Brauner
o userspace") 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 l

[PATCH v2 3/3] seccomp: test SECCOMP_USER_NOTIF_FLAG_CONTINUE

2019-09-20 Thread Christian Brauner
: 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 2/3] seccomp: avoid overflow in implicit constant conversion

2019-09-20 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:

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

2019-09-20 Thread Christian Brauner
u.com 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/secc

[PATCH] seccomp: remove unused arg from secure_computing()

2019-09-20 Thread Christian Brauner
While touching seccomp code I realized that the struct seccomp_data argument to secure_computing() seems to be unused by all current callers. So let's remove it unless there is some subtlety I missed. Note, I only tested this on x86. Signed-off-by: Christian Brauner Cc: Andy Lutomirsk

Re: For review: pidfd_send_signal(2) manual page

2019-09-24 Thread Christian Brauner
On Tue, Sep 24, 2019 at 09:44:49PM +0200, Michael Kerrisk (man-pages) wrote: > Hello Christian, > > On 9/23/19 4:23 PM, Christian Brauner wrote: > > On Mon, Sep 23, 2019 at 01:26:34PM +0200, Florian Weimer wrote: > >> * Michael Kerrisk: > >> > >>> SY

Re: [PATCH] selftests: pidfd: Fix undefined reference to pthread_create()

2019-09-24 Thread Christian Brauner
On Tue, Sep 24, 2019 at 01:52:37PM -0600, Shuah Khan wrote: > Fix build failure: > > undefined reference to `pthread_create' > collect2: error: ld returned 1 exit status > > Fix CFLAGS to include pthread correctly. > > Signed-off-by: Shuah Khan Reviewed-by: Chri

Re: For review: pidfd_send_signal(2) manual page

2019-09-24 Thread Christian Brauner
On Tue, Sep 24, 2019 at 09:57:04PM +0200, Christian Brauner wrote: > On Tue, Sep 24, 2019 at 09:44:49PM +0200, Michael Kerrisk (man-pages) wrote: > > Hello Christian, > > > > On 9/23/19 4:23 PM, Christian Brauner wrote: > > > On Mon, Sep 23, 2019 at 01:26:34

Re: For review: pidfd_send_signal(2) manual page

2019-09-24 Thread Christian Brauner
On Tue, Sep 24, 2019 at 11:00:03PM +0200, Michael Kerrisk (man-pages) wrote: > Hello Christian, > > >>> If you're the parent of the process you can do this without CLONE_PIDFD: > >>> pid = fork(); > >>> pidfd = pidfd_open(); > >>> ret = pidfd_send_signal(pidfd, 0, NULL, 0); > >>> if (ret < 0 && er

Re: For review: pidfd_send_signal(2) manual page

2019-09-25 Thread Christian Brauner
On Wed, Sep 25, 2019 at 03:46:26PM +0200, Michael Kerrisk (man-pages) wrote: > On 9/24/19 11:53 PM, Christian Brauner wrote: > > On Tue, Sep 24, 2019 at 11:00:03PM +0200, Michael Kerrisk (man-pages) wrote: > >> Hello Christian, > >> > >>>>> If you

Re: [PATCH v1 0/4] lib: introduce copy_struct_from_user() helper

2019-09-25 Thread Christian Brauner
On Wed, Sep 25, 2019 at 06:59:11PM +0200, Aleksa Sarai wrote: > This series was split off from the openat2(2) syscall discussion[1]. > However, the copy_struct_to_user() helper has been dropped, because > after some discussion it appears that there is no really obvious > semantics for how copy_stru

Re: [PATCH v1 1/4] lib: introduce copy_struct_from_user() helper

2019-09-25 Thread Christian Brauner
On Wed, Sep 25, 2019 at 06:59:12PM +0200, Aleksa Sarai wrote: > A common pattern for syscall extensions is increasing the size of a > struct passed from userspace, such that the zero-value of the new fields > result in the old kernel behaviour (allowing for a mix of userspace and > kernel vintages

Re: [PATCH v1 1/4] lib: introduce copy_struct_from_user() helper

2019-09-25 Thread Christian Brauner
On Wed, Sep 25, 2019 at 07:18:11PM +0200, Christian Brauner wrote: > On Wed, Sep 25, 2019 at 06:59:12PM +0200, Aleksa Sarai wrote: > > A common pattern for syscall extensions is increasing the size of a > > struct passed from userspace, such that the zero-value of the new fields &g

Re: [PATCH v1 2/4] clone3: switch to copy_struct_from_user()

2019-09-25 Thread Christian Brauner
On Wed, Sep 25, 2019 at 06:59:13PM +0200, Aleksa Sarai wrote: > The change is very straightforward, and helps unify the syscall > interface for struct-from-userspace syscalls. Additionally, explicitly > define CLONE_ARGS_SIZE_VER0 to match the other users of the > struct-extension pattern. > > Sig

Re: [PATCH v2 1/4] lib: introduce copy_struct_from_user() helper

2019-09-25 Thread Christian Brauner
On Thu, Sep 26, 2019 at 01:03:29AM +0200, Aleksa Sarai wrote: > A common pattern for syscall extensions is increasing the size of a > struct passed from userspace, such that the zero-value of the new fields > result in the old kernel behaviour (allowing for a mix of userspace and > kernel vintages

Re: [PATCH v2 1/4] lib: introduce copy_struct_from_user() helper

2019-09-26 Thread Christian Brauner
On Thu, Sep 26, 2019 at 01:03:29AM +0200, Aleksa Sarai wrote: > A common pattern for syscall extensions is increasing the size of a > struct passed from userspace, such that the zero-value of the new fields > result in the old kernel behaviour (allowing for a mix of userspace and > kernel vintages

Re: [PATCH v2 1/4] lib: introduce copy_struct_from_user() helper

2019-09-27 Thread Christian Brauner
On Fri, Sep 27, 2019 at 11:07:36AM +1000, Aleksa Sarai wrote: > On 2019-09-26, Christian Brauner wrote: > > On Thu, Sep 26, 2019 at 01:03:29AM +0200, Aleksa Sarai wrote: > > > +int is_zeroed_user(const void __user *from, size_t size) > > > +{ > > > + unsign

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

2019-09-27 Thread Christian Brauner
On Tue, Sep 03, 2019 at 09:16:51AM -0700, Hridya Valsaraju wrote: > Currently, the only way to access binder state and > statistics is through debugfs. We need a way to > access the same even when debugfs is not mounted. > These patches add a mount option to make this > information available in bin

Re: For review: pidfd_send_signal(2) manual page

2019-09-23 Thread Christian Brauner
On Mon, Sep 23, 2019 at 01:26:34PM +0200, Florian Weimer wrote: > * Michael Kerrisk: > > > SYNOPSIS > >int pidfd_send_signal(int pidfd, int sig, siginfo_t info, > > unsigned int flags); > > This probably should reference a header for siginfo_t. Agreed. > >

Re: For review: pidfd_send_signal(2) manual page

2019-09-23 Thread Christian Brauner
On Mon, Sep 23, 2019 at 11:12:00AM +0200, Michael Kerrisk (man-pages) wrote: > Hello Christian and all, > > Below, I have the rendered version of the current draft of > the pidfd_send_signal(2) manual page that I have written. > The page source can be found in a Git branch at: > https://git.kernel

Re: For review: pidfd_open(2) manual page

2019-09-23 Thread Christian Brauner
On Mon, Sep 23, 2019 at 11:11:53AM +0200, Michael Kerrisk (man-pages) wrote: > Hello Christian and all, > > Below, I have the rendered version of the current draft of > the pidfd_open(2) manual page that I have written. > The page source can be found in a Git branch at: > https://git.kernel.org/pu

Re: For review: pidfd_open(2) manual page

2019-09-23 Thread Christian Brauner
On Mon, Sep 23, 2019 at 12:53:09PM +0200, Florian Weimer wrote: > * Michael Kerrisk: > > > SYNOPSIS > >int pidfd_open(pid_t pid, unsigned int flags); > > Should this mention for pid_t? > > > ERRORS > >EINVAL flags is not 0. > > > >EINVAL pid is not valid. > > > >

Re: [PATCH] seccomp: remove unused arg from secure_computing()

2019-09-23 Thread Christian Brauner
On Mon, Sep 23, 2019 at 09:34:46PM +0200, Borislav Petkov wrote: > On Mon, Sep 23, 2019 at 11:41:59AM -0700, Andy Lutomirski wrote: > > On Mon, Sep 23, 2019 at 2:49 AM Borislav Petkov wrote: > > > > > > On Fri, Sep 20, 2019 at 03:19:09PM +0200, Christian Brauner wr

Re: [PATCH] seccomp: remove unused arg from secure_computing()

2019-09-23 Thread Christian Brauner
On Mon, Sep 23, 2019 at 11:41:59AM -0700, Andy Lutomirski wrote: > On Mon, Sep 23, 2019 at 2:49 AM Borislav Petkov wrote: > > > > On Fri, Sep 20, 2019 at 03:19:09PM +0200, Christian Brauner wrote: > > > While touching seccomp code I realized that the struct seccom

[PATCH v1] seccomp: simplify secure_computing()

2019-09-23 Thread Christian Brauner
comment in [2]). This is not true anymore though. /* References */ [1]: 2f275de5d1ed ("seccomp: Add a seccomp_data parameter secure_computing()") [2]: https://lore.kernel.org/r/calcetru_fs_at-htpr231kpaad0z7xjn4ku-dvzhru6cvcj...@mail.gmail.com Signed-off-by: Christian Brauner Cc: Andy Lu

Re: For review: pidfd_open(2) manual page

2019-09-24 Thread Christian Brauner
On Mon, Sep 23, 2019 at 10:41:19PM +0200, Florian Weimer wrote: > * Michael Kerrisk: > > >>>static > >>>int pidfd_open(pid_t pid, unsigned int flags) > >>>{ > >>>return syscall(__NR_pidfd_open, pid, flags); > >>>} > >> > >> Please call this function som

Re: [PATCH 1/2] arch: mark syscall number 435 reserved for clone3

2019-07-15 Thread Christian Brauner
On Mon, Jul 15, 2019 at 03:56:04PM +0200, Christian Borntraeger wrote: > I think Vasily already has a clone3 patch for s390x with 435. Excellent. I'll leave the # 435 reserved for clone3 on s390x in until this patch has landed. It shouldn't be a merge conflict and if so it should be trivial. Chr

[GIT PULL] pidfd and clone3 fixes

2019-07-15 Thread Christian Brauner
anks! Christian for-linus-20190715 ---- Christian Brauner (3): arch: mark syscall number 435 reserved for clone3 unistd: protect clone3 via __ARCH_WANT_SYS_CLONE3 M

Re: [GIT PULL] pidfd and clone3 fixes

2019-07-16 Thread Christian Brauner
On July 16, 2019 9:40:17 PM GMT+02:00, pr-tracker-...@kernel.org wrote: >The pull request you sent on Mon, 15 Jul 2019 17:15:09 +0200: > >> g...@gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux >tags/for-linus-20190715 > >has been merged into torvalds/linux.git: >https://git.kernel.org/to

Re: incoming

2019-07-17 Thread Christian Brauner
On Wed, Jul 17, 2019 at 09:13:26AM -0700, Linus Torvalds wrote: > On Wed, Jul 17, 2019 at 1:47 AM Vlastimil Babka wrote: > > > > So I've tried now to provide an example what I had in mind, below. > > I'll take it as a trial. I added one-line notes about coda and the > PTRACE_GET_SYSCALL_INFO inte

Re: [PATCH RFC v1] pidfd: fix a race in setting exit_state for pidfd polling

2019-07-17 Thread Christian Brauner
r users will see EXIT_ZOMBIE where they didn't see that before until after the parent failed to get notified. That's a rather subtle internal change. I was worried about __ptrace_detach() since it explicitly checks for EXIT_ZOMBIE but it seems to me that this is fine since we hold write_lo

Re: [PATCH RFC v1] pidfd: fix a race in setting exit_state for pidfd polling

2019-07-18 Thread Christian Brauner
On Wed, Jul 17, 2019 at 04:47:58PM -0400, Joel Fernandes wrote: > On Wed, Jul 17, 2019 at 11:09:59AM -0700, Suren Baghdasaryan wrote: > > On Wed, Jul 17, 2019 at 10:56 AM Christian Brauner > > wrote: > > > > > > On Wed, Jul 17, 2019 at 01:21:00PM -0400, Joel Fer

Re: [PATCH RFC v1] pidfd: fix a race in setting exit_state for pidfd polling

2019-07-18 Thread Christian Brauner
On Wed, Jul 17, 2019 at 01:21:00PM -0400, Joel Fernandes wrote: > From: Suren Baghdasaryan > > There is a race between reading task->exit_state in pidfd_poll and writing > it after do_notify_parent calls do_notify_pidfd. Expected sequence of > events is: > > CPU 0CPU

Re: [PATCH v2 1/4] capability: add ns_capable_cred()

2020-05-01 Thread Christian Brauner
On Thu, Apr 30, 2020 at 01:09:30PM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > Add a simple capability helper which makes it possible to determine > > whether a set of creds is ns capable wrt to the passed in credentials. > > This is not something e

Re: [PATCH v2 1/4] capability: add ns_capable_cred()

2020-05-02 Thread Christian Brauner
On Sat, May 02, 2020 at 07:35:53AM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Thu, Apr 30, 2020 at 01:09:30PM -0500, Eric W. Biederman wrote: > >> Christian Brauner writes: > >> > >> > Add a simple capability helper which mak

Re: [PATCH v2 1/4] capability: add ns_capable_cred()

2020-05-02 Thread Christian Brauner
On Sat, May 02, 2020 at 09:52:03AM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > On Sat, May 02, 2020 at 07:35:53AM -0500, Eric W. Biederman wrote: > >> Christian Brauner writes: > >> > >> > On Thu, Apr 30, 2020 at

[PATCH v3 0/3] nsproxy: attach to multiple namespaces

2020-05-04 Thread Christian Brauner
e with you. Christian Christian Brauner (3): nsproxy: add struct nsset nsproxy: attach to namespaces via pidfds selftests/pidfd: add pidfd setns tests fs/namespace.c| 15 +- fs/nsfs.c | 7 +- include/linux/mnt_n

[PATCH v3 3/3] selftests/pidfd: add pidfd setns tests

2020-05-04 Thread Christian Brauner
hat we can setns atomically into all namespaces of a target task - test that we can't cross setns into a user namespace outside of our user namespace hierarchy - test that we can't setns into namespaces owned by user namespaces over which we are not privileged Signed-off-by: Christia

[PATCH v3 1/3] nsproxy: add struct nsset

2020-05-04 Thread Christian Brauner
what order they are called in. Second, this makes the code easier to maintain and easier to follow if it needs to be changed. Cc: Eric W. Biederman Cc: Serge Hallyn Cc: Jann Horn Cc: Michael Kerrisk Cc: Aleksa Sarai Signed-off-by: Christian Brauner --- /* v2 */ patch introduced /* v3

[PATCH v3 2/3] nsproxy: attach to namespaces via pidfds

2020-05-04 Thread Christian Brauner
There's an installation/preparation state and a commit state similar to prepare_creds() and commit_creds(). /* v3 */ - Christian Brauner : - The patchset is mostly unchanged. It was only fixed-up in response to changes in earlier patches. --- fs/namespace.c| 5

Re: [PATCH v3 1/3] nsproxy: add struct nsset

2020-05-04 Thread Christian Brauner
On Mon, May 04, 2020 at 11:15:54AM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > Add a simple struct nsset. It holds all necessary pieces to switch to a new > > set of namespaces without leaving a task in a half-switched state which we > > will make

Re: [PATCH v3 2/3] nsproxy: attach to namespaces via pidfds

2020-05-04 Thread Christian Brauner
On Mon, May 04, 2020 at 11:25:07AM -0500, Eric W. Biederman wrote: > > I am not thrilled about treating nstype as a flags fields when it is not > currently. It was my hope when I designed the interface that not > treating nstype as a flags field would save us from the problem of bits > running ou

Re: [PATCH v3 4/7] linux/signal.h: Ignore SIGINFO by default in new tasks

2020-04-30 Thread Christian Brauner
On Thu, Apr 30, 2020 at 08:53:56AM +0200, Jiri Slaby wrote: > On 30. 04. 20, 8:42, Arseny Maslennikov wrote: > > This matches the behaviour of other Unix-like systems that have SIGINFO > > and causes less harm to processes that do not install handlers for this > > signal, making the keyboard status

Re: [PATCH v3 4/7] linux/signal.h: Ignore SIGINFO by default in new tasks

2020-04-30 Thread Christian Brauner
On Thu, Apr 30, 2020 at 05:37:28PM +1000, Aleksa Sarai wrote: > On 2020-04-30, Christian Brauner wrote: > > On Thu, Apr 30, 2020 at 08:53:56AM +0200, Jiri Slaby wrote: > > > On 30. 04. 20, 8:42, Arseny Maslennikov wrote: > > > > This matches the behaviour of oth

Re: [PATCH v3 0/5] Add support for RESOLVE_MAYEXEC

2020-04-30 Thread Christian Brauner
On Thu, Apr 30, 2020 at 11:54:29AM +1000, Aleksa Sarai wrote: > On 2020-04-28, Mickaël Salaün wrote: > > The goal of this patch series is to enable to control script execution > > with interpreters help. A new RESOLVE_MAYEXEC flag, usable through > > openat2(2), is added to enable userspace scrip

[PATCH v2 3/4] nsproxy: attach to namespaces via pidfds

2020-04-30 Thread Christian Brauner
ld be avoided with super careful userspace coding it would be nicer to have this done in-kernel. Pidfds seem to lend themselves nicely for this. The other neat thing about this is that setns() becomes an actual counterpart to the namespace bits of unshare(). Cc: Eric W. Biederman Cc: Serge Hallyn

[PATCH v2 2/4] nsproxy: add struct nsset

2020-04-30 Thread Christian Brauner
brings setns() closer to how unshare() works(). Cc: Eric W. Biederman Cc: Serge Hallyn Signed-off-by: Christian Brauner --- /* v2 */ patch introduced --- fs/namespace.c| 17 +-- include/linux/mnt_namespace.h | 2 + include/linux/nsproxy.h | 24 + include/linux

[PATCH v2 4/4] selftests/pidfd: add pidfd setns tests

2020-04-30 Thread Christian Brauner
hat we can setns atomically into all namespaces of a target task - test that we can't cross setns into a user namespace outside of our user namespace hierarchy - test that we can't setns into namespaces owned by user namespaces over which we are not privileged Signed-off-by: Christia

[PATCH v2 1/4] capability: add ns_capable_cred()

2020-04-30 Thread Christian Brauner
ument. In ptrace_has_cap() for example, we're using security_capable() directly. ns_capable_cred() will be used in the next patch to check against the target credentials the caller is going to switch to. Cc: Eric W. Biederman Cc: Serge Hallyn Signed-off-by: Christian Brauner --- /* v

Re: [PATCH v6] taskstats: fix data-race

2019-10-23 Thread Christian Brauner
On Wed, Oct 23, 2019 at 02:39:55PM +0200, Dmitry Vyukov wrote: > On Wed, Oct 23, 2019 at 2:16 PM Andrea Parri wrote: > > > > On Mon, Oct 21, 2019 at 01:33:27PM +0200, Christian Brauner wrote: > > > When assiging and testing taskstats in taskstats_exit() there's

Re: [RFC v2] ptrace, pidfd: add pidfd_ptrace syscall

2020-04-28 Thread Christian Brauner
On Tue, Apr 28, 2020 at 08:39:35AM +0200, Hagen Paul Pfeifer wrote: > * Linus Torvalds | 2020-04-27 21:28:14 [-0700]: > > >> I hate to say this, but I’m not convinced that asking the gdb folks is > >> the right approach. GDB has an ancient architecture and is > >> *incredibly* buggy. I’m sure ptra

Re: [RFC v2] ptrace, pidfd: add pidfd_ptrace syscall

2020-04-28 Thread Christian Brauner
On Mon, Apr 27, 2020 at 09:28:14PM -0700, Linus Torvalds wrote: > On Mon, Apr 27, 2020 at 9:17 PM Andy Lutomirski wrote: > > > > I hate to say this, but I’m not convinced that asking the gdb folks is > > the right approach. GDB has an ancient architecture and is > > *incredibly* buggy. I’m sure pt

Re: [PATCH 0/3] bpf: switch to new usercopy helpers

2019-10-10 Thread Christian Brauner
On Wed, Oct 09, 2019 at 04:06:18PM -0700, Alexei Starovoitov wrote: > On Wed, Oct 9, 2019 at 9:09 AM Christian Brauner > wrote: > > > > Hey everyone, > > > > In v5.4-rc2 we added two new helpers check_zeroed_user() and > > copy_struct_from_user() including

[PATCH 2/2] tests: test CLONE3_CLEAR_SIGHAND

2019-10-10 Thread Christian Brauner
Test that CLONE3_CLEAR_SIGHAND resets signal handlers to SIG_DFL for the child process and that CLONE3_CLEAR_SIGHAND and CLONE_SIGHAND are mutually exclusive. Cc: Florian Weimer Cc: libc-al...@sourceware.org Signed-off-by: Christian Brauner --- MAINTAINERS

[PATCH 1/2] clone3: add CLONE3_CLEAR_SIGHAND

2019-10-10 Thread Christian Brauner
the future? Members of the audience suggested that more glibc developers should perhaps join the linux-api list. The other suggestion was to "copy Florian on everything".' Cc: Oleg Nesterov Cc: Florian Weimer Cc: libc-al...@sourceware.org Signed-off-by: Christian Brauner

Re: [PATCH 1/2] clone3: add CLONE3_CLEAR_SIGHAND

2019-10-10 Thread Christian Brauner
On Thu, Oct 10, 2019 at 04:19:44PM +0200, Florian Weimer wrote: > * Christian Brauner: > > > @@ -2567,7 +2572,7 @@ static bool clone3_args_valid(const struct > > kernel_clone_args *kargs) > > * All lower bits of the flag word are taken. > > * Verify t

Re: [PATCH 1/2] clone3: add CLONE3_CLEAR_SIGHAND

2019-10-11 Thread Christian Brauner
On Fri, Oct 11, 2019 at 10:21:18AM +0200, Michal Hocko wrote: > [Cc linux-api] Right, thanks Michal. Christian

Re: [PATCH] usercopy: Avoid soft lockups in test_check_nonzero_user()

2019-10-11 Thread Christian Brauner
On Fri, Oct 11, 2019 at 02:48:10PM +1100, Aleksa Sarai wrote: > On 2019-10-11, Michael Ellerman wrote: > > On a machine with a 64K PAGE_SIZE, the nested for loops in > > test_check_nonzero_user() can lead to soft lockups, eg: > > > > watchdog: BUG: soft lockup - CPU#4 stuck for 22s! [modprobe:6

Re: [PATCH v1] seccomp: simplify secure_computing()

2019-10-11 Thread Christian Brauner
On Thu, Oct 10, 2019 at 02:53:24PM -0700, Kees Cook wrote: > On Tue, Sep 24, 2019 at 08:44:20AM +0200, Christian Brauner wrote: > > Afaict, the struct seccomp_data argument to secure_computing() is unused > > by all current callers. So let's remove it. > > The argumen

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

2019-10-11 Thread Christian Brauner
On Thu, Oct 10, 2019 at 02:45:38PM -0700, Kees Cook wrote: > On Fri, Sep 20, 2019 at 10:30:05AM +0200, Christian Brauner wrote: > > + * Similar precautions should be applied when stacking > > SECCOMP_RET_USER_NOTIF. > > + * For SECCOMP_RET_USER_NOTIF filters acting on

[PATCH v2 2/2] tests: test CLONE3_CLEAR_SIGHAND

2019-10-11 Thread Christian Brauner
Test that CLONE3_CLEAR_SIGHAND resets signal handlers to SIG_DFL for the child process and that CLONE3_CLEAR_SIGHAND and CLONE_SIGHAND are mutually exclusive. Cc: Florian Weimer Cc: libc-al...@sourceware.org Cc: linux-...@vger.kernel.org Signed-off-by: Christian Brauner --- /* v1 */ Link

[PATCH v2 1/2] clone3: add CLONE3_CLEAR_SIGHAND

2019-10-11 Thread Christian Brauner
the future? Members of the audience suggested that more glibc developers should perhaps join the linux-api list. The other suggestion was to "copy Florian on everything".' Cc: Oleg Nesterov Cc: Florian Weimer Cc: libc-al...@sourceware.org Cc: linux-...@vger.kernel.org

Re: [PATCH v3 1/2] pidfd: show pids for nested pid namespaces in fdinfo

2019-10-11 Thread Christian Brauner
cess ids of the process in > all nested namespaces in the same format as in the procfs status > file, i.e. "NSPid:\t%d\%d...". This allows the easy identification > of the processes in nested namespaces. > > Signed-off-by: Christian Kellner Reviewed-by: Christian Brauner If

Re: [PATCH v3 2/2] pidfd: add tests for NSpid info in fdinfo

2019-10-11 Thread Christian Brauner
sted namespaces. > > Signed-off-by: Christian Kellner Acked-by: Christian Brauner Shuah, can I get an Ack for you from this. If you have no objections I'd queue up this patchset for the 5.5 merge window. Thanks! Christian

Re: NULL pointer deref in put_fs_context with unprivileged LXC

2019-10-11 Thread Christian Brauner
On Thu, Oct 10, 2019 at 11:35:12PM +0200, Thibaut Sautereau wrote: > Since v5.1 and as of v5.3.5, I get the following oops every single time > I start an *unprivileged* LXC container: > > BUG: kernel NULL pointer dereference, address: 0043 > #PF: supervisor read access in k

Re: [PATCH v3 1/2] pidfd: show pids for nested pid namespaces in fdinfo

2019-10-11 Thread Christian Brauner
On Fri, Oct 11, 2019 at 04:55:59PM +0200, Jann Horn wrote: > On Fri, Oct 11, 2019 at 2:23 PM Christian Kellner wrote: > > The fdinfo file for a process file descriptor already contains the > > pid of the process in the callers namespaces. Additionally, if pid > > namespaces are configured, show th

Re: [PATCH v3 1/2] pidfd: show pids for nested pid namespaces in fdinfo

2019-10-11 Thread Christian Brauner
On Fri, Oct 11, 2019 at 05:30:03PM +0200, Jann Horn wrote: > On Fri, Oct 11, 2019 at 5:17 PM Christian Brauner > wrote: > > > > On Fri, Oct 11, 2019 at 04:55:59PM +0200, Jann Horn wrote: > > > On Fri, Oct 11, 2019 at 2:23 PM Christian Kellner > > > wrote: &

Re: [PATCH v2 2/2] pidfd: add tests for NSpid info in fdinfo

2019-10-11 Thread Christian Brauner
On Fri, Oct 11, 2019 at 05:09:29PM +0200, Jann Horn wrote: > On Wed, Oct 9, 2019 at 6:10 PM Christian Kellner wrote: > > Add tests that check that if pid namespaces are configured the fdinfo > > file of a pidfd contains an NSpid: entry containing the process id > > in the current and additionally

Re: [PATCH 1/2] clone3: add CLONE3_CLEAR_SIGHAND

2019-10-12 Thread Christian Brauner
On Sat, Oct 12, 2019 at 08:53:34AM +0200, Michael Kerrisk (man-pages) wrote: > Hello Aleksa, > > On Sat, 12 Oct 2019 at 00:12, Aleksa Sarai wrote: > > > > On 2019-10-11, Michael Kerrisk wrote: > > > Why CLONE3_CLEAR_SIGHAND rather than just CLONE_CLEAR_SIGHAND? I don't care much how we name thi

[PATCH] pidfd: add NSpid entries to fdinfo

2019-10-12 Thread Christian Brauner
ernel.org Co-Developed-by: Christian Kellner Signed-off-by: Christian Kellner Signed-off-by: Christian Brauner --- kernel/fork.c | 73 ++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/kernel/fork.c b/kernel/fork.c index 1f6c45f6a734..

Re: [PATCH] pidfd: add NSpid entries to fdinfo

2019-10-12 Thread Christian Brauner
On Sat, Oct 12, 2019 at 12:19:22PM +0200, Christian Brauner wrote: > Currently, the fdinfo file of contains the field Pid: > It contains the pid a given pidfd refers to in the pid namespace of the > opener's procfs instance. > If the pid namespace of the process is not a desc

Re: [PATCH] samples: fix binderfs sample

2020-04-29 Thread Christian Brauner
Thanks for fixing this Arnd! Acked-by: Christian Brauner

Re: [PATCH 1/2] clone3: add CLONE3_CLEAR_SIGHAND

2019-10-14 Thread Christian Brauner
On Sat, Oct 12, 2019 at 01:46:54PM +0200, Michael Kerrisk (man-pages) wrote: > On 10/12/19 9:48 AM, Christian Brauner wrote: > > On Sat, Oct 12, 2019 at 08:53:34AM +0200, Michael Kerrisk (man-pages) wrote: > >> Hello Aleksa, > >> > >> On Sat, 12 Oc

Re: [PATCH] pidfd: add NSpid entries to fdinfo

2019-10-14 Thread Christian Brauner
On Mon, Oct 14, 2019 at 11:43:01AM +0200, Christian Kellner wrote: > On Sat, 2019-10-12 at 12:21 +0200, Christian Brauner wrote: > > I think this might be more what we want. > Yep, indeed. > > > I tried to think of cases where the first entry of Pid is not > > identica

[PATCH v3 1/2] clone3: add CLONE_CLEAR_SIGHAND

2019-10-14 Thread Christian Brauner
the future? Members of the audience suggested that more glibc developers should perhaps join the linux-api list. The other suggestion was to "copy Florian on everything".' Cc: Oleg Nesterov Cc: Florian Weimer Cc: libc-al...@sourceware.org Cc: linux-...@vger.kernel.org

[PATCH v3 2/2] tests: test CLONE_CLEAR_SIGHAND

2019-10-14 Thread Christian Brauner
Test that CLONE_CLEAR_SIGHAND resets signal handlers to SIG_DFL for the child process and that CLONE_CLEAR_SIGHAND and CLONE_SIGHAND are mutually exclusive. Cc: Florian Weimer Cc: libc-al...@sourceware.org Cc: linux-...@vger.kernel.org Signed-off-by: Christian Brauner --- /* v1 */ Link: https

Re: [PATCH] pidfd: add NSpid entries to fdinfo

2019-10-14 Thread Christian Brauner
On October 14, 2019 5:09:58 PM GMT+02:00, Jann Horn wrote: >On Sat, Oct 12, 2019 at 12:19 PM Christian Brauner > wrote: >> Currently, the fdinfo file of contains the field Pid: > >nit: something missing after "of"? > >> It contains the pid a given pidfd r

Re: [PATCH v4 1/2] pidfd: add NSpid entries to fdinfo

2019-10-15 Thread Christian Brauner
to > pidfd_show_fdinfo with a detailed explanation of Pid and NSpid fields. > > Co-developed-by: Christian Brauner > Signed-off-by: Christian Brauner > Signed-off-by: Christian Kellner Thanks! Reviewed-by: Christian Brauner > --- > Changes in v4: > - Reworked to

Re: [PATCH v4 2/2] pidfd: add tests for NSpid info in fdinfo

2019-10-15 Thread Christian Brauner
sted namespaces. In the case that > a pidfd is from a pid namespace not in the same namespace hierarchy as > the process accessing the fdinfo file, ensure the 'NSpid' shows 0 for > that pidfd, analogous to the 'Pid' entry. > > Signed-off-by: Christian Kellner

[PATCH 1/2] pidfd: verify task is alive when printing fdinfo

2019-10-15 Thread Christian Brauner
n Kellner Cc: Oleg Nesterov Cc: linux-...@vger.kernel.org Signed-off-by: Christian Brauner --- kernel/fork.c | 29 +++-- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index 782986962d47..a67944a5e542 100644 --- a/kernel/fork.c

[PATCH 2/2] test: verify fdinfo for pidfd of reaped process

2019-10-15 Thread Christian Brauner
Test that the fdinfo field of a pidfd referring to a dead process correctly shows Pid: -1 and NSpid: -1. Cc: Christian Kellner Signed-off-by: Christian Brauner --- .../selftests/pidfd/pidfd_fdinfo_test.c | 59 ++- 1 file changed, 45 insertions(+), 14 deletions(-) diff

Re: [PATCH] pidfd: fix selftest compilation by removing linux/wait.h

2019-10-15 Thread Christian Brauner
On Fri, Oct 11, 2019 at 06:38:11PM +0200, Christian Kellner wrote: > From: Christian Kellner > > The pidfd_{open,poll}_test.c files both include `linux/wait.h` and > later `sys/wait.h`. The former has `#define P_ALL 0`, but in the > latter P_ALL is part of idtype_t enum, where it gets substituted

Re: [PATCH 1/2] pidfd: verify task is alive when printing fdinfo

2019-10-15 Thread Christian Brauner
On Tue, Oct 15, 2019 at 04:43:57PM +0200, Oleg Nesterov wrote: > On 10/15, Christian Brauner wrote: > > > > +static inline bool task_alive(struct pid *pid) > > +{ > > + bool alive = true; > > + > > + rcu_read_lock(); > > + if (!pid_task(pid

Re: [PATCH v2] pidfd: avoid linux/wait.h and sys/wait.h name clashes

2019-10-15 Thread Christian Brauner
uture clash, in > case P_PIDFD gets added to the idtype_t enum in sys/wait.h. > > Signed-off-by: Christian Kellner Reviewed-by: Christian Brauner

Re: [PATCH 0/3] bpf: switch to new usercopy helpers

2019-10-15 Thread Christian Brauner
On Tue, Oct 15, 2019 at 03:45:54PM -0700, Alexei Starovoitov wrote: > On Thu, Oct 10, 2019 at 2:26 AM Christian Brauner > wrote: > > > > On Wed, Oct 09, 2019 at 04:06:18PM -0700, Alexei Starovoitov wrote: > > > On Wed, Oct 9, 2019 at 9:09 AM Christian Brauner > &

Re: [PATCH 0/3] bpf: switch to new usercopy helpers

2019-10-15 Thread Christian Brauner
On Tue Oct 15, 2019 at 4:02 PM Alexei Starovoitov wrote: > On Tue, Oct 15, 2019 at 3:55 PM Christian Brauner > wrote: > > > > On Tue, Oct 15, 2019 at 03:45:54PM -0700, Alexei Starovoitov wrote: > > > On Thu, Oct 10, 2019 at 2:26 AM Christian Brauner > > > w

[PATCH v2 3/3] bpf: use copy_struct_from_user() in bpf() syscall

2019-10-15 Thread Christian Brauner
() already. So technically, the min_t() call could go. But the size is used further below so leave it. [1]: f5a1a536fa14 ("lib: introduce copy_struct_from_user() helper") Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: b...@vger.kernel.org Acked-by: Aleksa Sarai Signed-off-by: Christi

[PATCH v2 2/3] bpf: use copy_struct_from_user() in bpf_prog_get_info_by_fd()

2019-10-15 Thread Christian Brauner
() already. So technically, the min_t() call could go. But the info_len is used further below so leave it. [1]: f5a1a536fa14 ("lib: introduce copy_struct_from_user() helper") Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: b...@vger.kernel.org Acked-by: Aleksa Sarai Signed-off-by:

[PATCH v2 1/3] bpf: use check_zeroed_user() in bpf_check_uarg_tail_zero()

2019-10-15 Thread Christian Brauner
introduce copy_struct_from_user() helper") Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: b...@vger.kernel.org Acked-by: Aleksa Sarai Signed-off-by: Christian Brauner --- /* v1 */ Link: https://lore.kernel.org/r/20191009160907.10981-2-christian.brau...@ubuntu.com /* v2 */ - Alexei Starovoitov : - A

[PATCH v2 0/3] bpf: switch to new usercopy helpers

2019-10-15 Thread Christian Brauner
introduce copy_struct_from_user() helper") Christian Brauner (3): bpf: use check_zeroed_user() in bpf_check_uarg_tail_zero() bpf: use copy_struct_from_user() in bpf_prog_get_info_by_fd() bpf: use copy_struct_from_user() in bpf() syscall kernel/bpf

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