Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1445173 > unrolled thread

linux-next: manual merge of the kspp tree with the arm64 tree

Started byStephen Rothwell <sfr@canb.auug.org.au>
First post2016-07-18 05:10 +0200
Last post2016-07-18 07:20 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  linux-next: manual merge of the kspp tree with the arm64 tree Stephen Rothwell <sfr@canb.auug.org.au> - 2016-07-18 05:10 +0200
    Re: linux-next: manual merge of the kspp tree with the arm64 tree Kees Cook <keescook@google.com> - 2016-07-18 06:50 +0200
      Re: linux-next: manual merge of the kspp tree with the arm64 tree Stephen Rothwell <sfr@canb.auug.org.au> - 2016-07-18 07:10 +0200
        Re: linux-next: manual merge of the kspp tree with the arm64 tree Kees Cook <keescook@google.com> - 2016-07-18 07:20 +0200

#1445173 — linux-next: manual merge of the kspp tree with the arm64 tree

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2016-07-18 05:10 +0200
Subjectlinux-next: manual merge of the kspp tree with the arm64 tree
Message-ID<rW76p-IH-5@gated-at.bofh.it>
Hi Kees,

Today's linux-next merge of the kspp tree got a conflict in:

  arch/arm64/include/asm/uaccess.h

between commit:

  bffe1baff5d5 ("arm64: kasan: instrument user memory access API")

from the arm64 tree and commit:

  b19e7f50f056 ("arm64/uaccess: Enable hardened usercopy")

from the kspp tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/arm64/include/asm/uaccess.h
index 5e834d10b291,1779cbdb7838..000000000000
--- a/arch/arm64/include/asm/uaccess.h
+++ b/arch/arm64/include/asm/uaccess.h
@@@ -264,14 -276,14 +264,15 @@@ extern unsigned long __must_check __cle
  
  static inline unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n)
  {
 +	kasan_check_write(to, n);
- 	return  __arch_copy_from_user(to, from, n);
+ 	check_object_size(to, n, false);
+ 	return __arch_copy_from_user(to, from, n);
  }
  
  static inline unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n)
  {
 -	check_object_size(from, n, true);
 +	kasan_check_read(from, n);
- 	return  __arch_copy_to_user(to, from, n);
+ 	return __arch_copy_to_user(to, from, n);
  }
  
  static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n)

[toc] | [next] | [standalone]


#1445202

FromKees Cook <keescook@google.com>
Date2016-07-18 06:50 +0200
Message-ID<rW8Fb-1zz-7@gated-at.bofh.it>
In reply to#1445173
On Sun, Jul 17, 2016 at 7:59 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Kees,
>
> Today's linux-next merge of the kspp tree got a conflict in:
>
>   arch/arm64/include/asm/uaccess.h
>
> between commit:
>
>   bffe1baff5d5 ("arm64: kasan: instrument user memory access API")
>
> from the arm64 tree and commit:
>
>   b19e7f50f056 ("arm64/uaccess: Enable hardened usercopy")
>
> from the kspp tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> --
> Cheers,
> Stephen Rothwell
>
> diff --cc arch/arm64/include/asm/uaccess.h
> index 5e834d10b291,1779cbdb7838..000000000000
> --- a/arch/arm64/include/asm/uaccess.h
> +++ b/arch/arm64/include/asm/uaccess.h
> @@@ -264,14 -276,14 +264,15 @@@ extern unsigned long __must_check __cle
>
>   static inline unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n)
>   {
>  +      kasan_check_write(to, n);
> -       return  __arch_copy_from_user(to, from, n);
> +       check_object_size(to, n, false);
> +       return __arch_copy_from_user(to, from, n);
>   }
>
>   static inline unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n)
>   {
>  -      check_object_size(from, n, true);
>  +      kasan_check_read(from, n);
> -       return  __arch_copy_to_user(to, from, n);
> +       return __arch_copy_to_user(to, from, n);

If I'm reading correctly, this second fixup is wrong. It should read;

    kasan_check_read(from, n);
    check_object_size(from, n, true);
    return __arch_copy_to_user(to, from, n);

(i.e. fix double space between "return" and "__arch_copy..." in both
chunks and add check_object_size() calls after the kasan calls in both
chunks.

-Kees

-- 
Kees Cook
Brillo & Chrome OS Security

[toc] | [prev] | [next] | [standalone]


#1445208

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2016-07-18 07:10 +0200
Message-ID<rW8Yx-1VK-5@gated-at.bofh.it>
In reply to#1445202
Hi Kees,

On Sun, 17 Jul 2016 21:49:40 -0700 Kees Cook <keescook@google.com> wrote:
>
> If I'm reading correctly, this second fixup is wrong. It should read;
> 
>     kasan_check_read(from, n);
>     check_object_size(from, n, true);
>     return __arch_copy_to_user(to, from, n);
> 
> (i.e. fix double space between "return" and "__arch_copy..." in both
> chunks and add check_object_size() calls after the kasan calls in both
> chunks.

Yep, sorry.  I will fix it up tomorrow.

-- 
Cheers,
Stephen Rothwell

[toc] | [prev] | [next] | [standalone]


#1445214

FromKees Cook <keescook@google.com>
Date2016-07-18 07:20 +0200
Message-ID<rW98e-1ZF-13@gated-at.bofh.it>
In reply to#1445208
On Sun, Jul 17, 2016 at 10:06 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Kees,
>
> On Sun, 17 Jul 2016 21:49:40 -0700 Kees Cook <keescook@google.com> wrote:
>>
>> If I'm reading correctly, this second fixup is wrong. It should read;
>>
>>     kasan_check_read(from, n);
>>     check_object_size(from, n, true);
>>     return __arch_copy_to_user(to, from, n);
>>
>> (i.e. fix double space between "return" and "__arch_copy..." in both
>> chunks and add check_object_size() calls after the kasan calls in both
>> chunks.
>
> Yep, sorry.  I will fix it up tomorrow.

Cool, thanks! :)

-Kees

-- 
Kees Cook
Brillo & Chrome OS Security

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web