Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 09:27:18PM +1000, Aleksa Sarai wrote: > On 2019-09-05, Christian Brauner wrote: > > On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > > > A common pattern for syscall extensions is increasing the size of a > > > struct passed from userspace, such that the

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 07:07:50PM +0100, Al Viro wrote: > On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > > +/* > > + * "memset(p, 0, size)" but for user space buffers. Caller must have > > already > > + * checked access_ok(p, size). > > + */ > > +static int __memzero_user(void

[PATCH v7 1/2] powerpc/xmon: Allow listing and clearing breakpoints in read-only mode

2019-09-07 Thread Christopher M. Riedl
Read-only mode should not prevent listing and clearing any active breakpoints. Tested-by: Daniel Axtens Reviewed-by: Daniel Axtens Signed-off-by: Christopher M. Riedl --- arch/powerpc/xmon/xmon.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git

[PATCH v7 2/2] powerpc/xmon: Restrict when kernel is locked down

2019-09-07 Thread Christopher M. Riedl
Xmon should be either fully or partially disabled depending on the kernel lockdown state. Put xmon into read-only mode for lockdown=integrity and prevent user entry into xmon when lockdown=confidentiality. Xmon checks the lockdown state on every attempted entry: (1) during early xmon'ing (2)

[PATCH v7 0/2] Restrict xmon when kernel is locked down

2019-09-07 Thread Christopher M. Riedl
Xmon should be either fully or partially disabled depending on the kernel lockdown state. Put xmon into read-only mode for lockdown=integrity and completely disable xmon when lockdown=confidentiality. Since this can occur dynamically, there may be pre-existing, active breakpoints in xmon when

Re: [PATCH v2] powerpc/lockdep: fix a false positive warning

2019-09-07 Thread Ingo Molnar
* Qian Cai wrote: > The commit 108c14858b9e ("locking/lockdep: Add support for dynamic > keys") introduced a boot warning on powerpc below, because since the > commit 2d4f567103ff ("KVM: PPC: Introduce kvm_tmp framework") adds > kvm_tmp[] into the .bss section and then free the rest of unused

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 07:50:26PM +1000, Aleksa Sarai wrote: > On 2019-09-05, Rasmus Villemoes wrote: > > On 04/09/2019 22.19, 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

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 06:19:22AM +1000, 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 v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 06:19:22AM +1000, 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 v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 01:17:38PM +0200, Rasmus Villemoes wrote: > On 05/09/2019 13.05, Christian Brauner wrote: > > On Thu, Sep 05, 2019 at 06:19:22AM +1000, Aleksa Sarai wrote: > > >> + if (unlikely(!access_ok(dst, usize))) > >> + return -EFAULT; > >> + > >> + /* Deal with trailing

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Thu, Sep 05, 2019 at 07:28:01PM +0100, Al Viro wrote: > On Thu, Sep 05, 2019 at 08:23:03PM +0200, Christian Brauner wrote: > > > Because every caller of that function right now has that limit set > > anyway iirc. So we can either remove it from here and place it back for > > the individual

Re: [PATCH v12 01/12] lib: introduce copy_struct_{to,from}_user helpers

2019-09-07 Thread Christian Brauner
On Fri, Sep 06, 2019 at 05:56:18AM +1000, Aleksa Sarai wrote: > On 2019-09-05, Al Viro wrote: > > On Thu, Sep 05, 2019 at 08:23:03PM +0200, Christian Brauner wrote: > > > > > Because every caller of that function right now has that limit set > > > anyway iirc. So we can either remove it from

Re: [PATCH v2] powerpc/lockdep: fix a false positive warning

2019-09-07 Thread Qian Cai
> On Sep 7, 2019, at 3:05 AM, Ingo Molnar wrote: > > > * Qian Cai wrote: > >> The commit 108c14858b9e ("locking/lockdep: Add support for dynamic >> keys") introduced a boot warning on powerpc below, because since the >> commit 2d4f567103ff ("KVM: PPC: Introduce kvm_tmp framework") adds >>

Re: [PATCH] net/ibmvnic: free reset work of removed device from queue

2019-09-07 Thread David Miller
From: Juliet Kim Date: Thu, 5 Sep 2019 17:30:01 -0400 > Commit 36f1031c51a2 ("ibmvnic: Do not process reset during or after > device removal") made the change to exit reset if the driver has been > removed, but does not free reset work items of the adapter from queue. > > Ensure all reset

Re: [PATCH v12 11/12] open: openat2(2) syscall

2019-09-07 Thread Jeff Layton
On Thu, 2019-09-05 at 06:19 +1000, Aleksa Sarai wrote: > The most obvious syscall to add support for the new LOOKUP_* scoping > flags would be openat(2). However, there are a few reasons why this is > not the best course of action: > > * The new LOOKUP_* flags are intended to be security

Re: [PATCH v12 11/12] open: openat2(2) syscall

2019-09-07 Thread Andy Lutomirski
> On Sep 7, 2019, at 10:45 AM, Linus Torvalds > wrote: > >> On Sat, Sep 7, 2019 at 10:42 AM Andy Lutomirski wrote: >> >> Linus, you rejected resolveat() because you wanted a *nice* API > > No. I rejected resoveat() because it was a completely broken garbage > API that couldn't do even

Re: [PATCH v12 11/12] open: openat2(2) syscall

2019-09-07 Thread Linus Torvalds
On Sat, Sep 7, 2019 at 5:40 AM Jeff Layton wrote: > > After thinking about this a bit, I wonder if we might be better served > with a new set of OA2_* flags instead of repurposing the O_* flags? I'd hate to have yet _another_ set of translation functions, and another chance of people just

Re: [PATCH v12 11/12] open: openat2(2) syscall

2019-09-07 Thread Andy Lutomirski
> On Sep 7, 2019, at 9:58 AM, Linus Torvalds > wrote: > >> On Sat, Sep 7, 2019 at 5:40 AM Jeff Layton wrote: >> >> After thinking about this a bit, I wonder if we might be better served >> with a new set of OA2_* flags instead of repurposing the O_* flags? > > I'd hate to have yet

Re: [PATCH v12 11/12] open: openat2(2) syscall

2019-09-07 Thread Linus Torvalds
On Sat, Sep 7, 2019 at 10:42 AM Andy Lutomirski wrote: > > Linus, you rejected resolveat() because you wanted a *nice* API No. I rejected resoveat() because it was a completely broken garbage API that couldn't do even basic stuff right (like O_CREAT). We have a ton of flag space in the new