All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the kspp tree with the arm64 tree
@ 2016-07-21  2:34 Stephen Rothwell
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Rothwell @ 2016-07-21  2:34 UTC (permalink / raw)
  To: Kees Cook, Catalin Marinas; +Cc: linux-next, linux-kernel, Yang Shi

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:

  aac380fe78b1 ("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,c3d445b42351..000000000000
--- a/arch/arm64/include/asm/uaccess.h
+++ b/arch/arm64/include/asm/uaccess.h
@@@ -264,33 -276,32 +264,38 @@@ 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)
  {
 +	kasan_check_read(from, n);
- 	return  __arch_copy_to_user(to, from, n);
+ 	check_object_size(from, n, true);
+ 	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)
  {
 +	kasan_check_write(to, n);
 +
- 	if (access_ok(VERIFY_READ, from, n))
+ 	if (access_ok(VERIFY_READ, from, n)) {
+ 		check_object_size(to, n, false);
  		n = __arch_copy_from_user(to, from, n);
- 	else /* security hole - plug it */
+ 	} else /* security hole - plug it */
  		memset(to, 0, n);
  	return n;
  }
  
  static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n)
  {
 +	kasan_check_read(from, n);
 +
- 	if (access_ok(VERIFY_WRITE, to, n))
+ 	if (access_ok(VERIFY_WRITE, to, n)) {
+ 		check_object_size(from, n, true);
  		n = __arch_copy_to_user(to, from, n);
+ 	}
  	return n;
  }
  

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: manual merge of the kspp tree with the arm64 tree
  2022-09-27 18:59 broonie
  2022-09-27 19:28 ` Kees Cook
@ 2022-10-05  0:22 ` Stephen Rothwell
  1 sibling, 0 replies; 9+ messages in thread
From: Stephen Rothwell @ 2022-10-05  0:22 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: broonie, Kees Cook, Linux Kernel Mailing List,
	Linux Next Mailing List, Mark Rutland, Sami Tolvanen

[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]

Hi all,

On Tue, 27 Sep 2022 19:59:11 +0100 broonie@kernel.org wrote:
> 
> Today's linux-next merge of the kspp tree got a conflict in:
> 
>   arch/arm64/kernel/alternative.c
> 
> between commit:
> 
>   b723edf3a12a2 ("arm64: alternatives: make alt_region const")
> 
> from the arm64 tree and commit:
> 
>   5f20997c194e8 ("arm64: Drop unneeded __nocfi attributes")
> 
> 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.
> 
> diff --cc arch/arm64/kernel/alternative.c
> index 64045e3ef03a9,d2c66507398d7..0000000000000
> --- a/arch/arm64/kernel/alternative.c
> +++ b/arch/arm64/kernel/alternative.c
> @@@ -139,9 -133,8 +139,9 @@@ static void clean_dcache_range_nopatch(
>   	} while (cur += d_size, cur < end);
>   }
>   
> - static void __nocfi __apply_alternatives(const struct alt_region *region,
> - 					 bool is_module,
> - 					 unsigned long *feature_mask)
>  -static void __apply_alternatives(struct alt_region *region, bool is_module,
> ++static void __apply_alternatives(const struct alt_region *region,
> ++				 bool is_module,
> + 				 unsigned long *feature_mask)
>   {
>   	struct alt_instr *alt;
>   	__le32 *origptr, *updptr;

This is now a conflict between the arm64 tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: manual merge of the kspp tree with the arm64 tree
  2022-09-27 18:59 broonie
@ 2022-09-27 19:28 ` Kees Cook
  2022-10-05  0:22 ` Stephen Rothwell
  1 sibling, 0 replies; 9+ messages in thread
From: Kees Cook @ 2022-09-27 19:28 UTC (permalink / raw)
  To: broonie
  Cc: Catalin Marinas, Linux Kernel Mailing List,
	Linux Next Mailing List, Mark Rutland, Sami Tolvanen

On Tue, Sep 27, 2022 at 07:59:11PM +0100, broonie@kernel.org wrote:
> Hi all,
> 
> Today's linux-next merge of the kspp tree got a conflict in:
> 
>   arch/arm64/kernel/alternative.c
> 
> between commit:
> 
>   b723edf3a12a2 ("arm64: alternatives: make alt_region const")
> 
> from the arm64 tree and commit:
> 
>   5f20997c194e8 ("arm64: Drop unneeded __nocfi attributes")
> 
> 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.
> 
> diff --cc arch/arm64/kernel/alternative.c
> index 64045e3ef03a9,d2c66507398d7..0000000000000
> --- a/arch/arm64/kernel/alternative.c
> +++ b/arch/arm64/kernel/alternative.c
> @@@ -139,9 -133,8 +139,9 @@@ static void clean_dcache_range_nopatch(
>   	} while (cur += d_size, cur < end);
>   }
>   
> - static void __nocfi __apply_alternatives(const struct alt_region *region,
> - 					 bool is_module,
> - 					 unsigned long *feature_mask)
>  -static void __apply_alternatives(struct alt_region *region, bool is_module,
> ++static void __apply_alternatives(const struct alt_region *region,
> ++				 bool is_module,
> + 				 unsigned long *feature_mask)
>   {
>   	struct alt_instr *alt;
>   	__le32 *origptr, *updptr;

Thanks! Yes, this looks correct.

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 9+ messages in thread

* linux-next: manual merge of the kspp tree with the arm64 tree
@ 2022-09-27 18:59 broonie
  2022-09-27 19:28 ` Kees Cook
  2022-10-05  0:22 ` Stephen Rothwell
  0 siblings, 2 replies; 9+ messages in thread
From: broonie @ 2022-09-27 18:59 UTC (permalink / raw)
  To: Kees Cook
  Cc: Catalin Marinas, Linux Kernel Mailing List,
	Linux Next Mailing List, Mark Rutland, Sami Tolvanen

Hi all,

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

  arch/arm64/kernel/alternative.c

between commit:

  b723edf3a12a2 ("arm64: alternatives: make alt_region const")

from the arm64 tree and commit:

  5f20997c194e8 ("arm64: Drop unneeded __nocfi attributes")

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.

diff --cc arch/arm64/kernel/alternative.c
index 64045e3ef03a9,d2c66507398d7..0000000000000
--- a/arch/arm64/kernel/alternative.c
+++ b/arch/arm64/kernel/alternative.c
@@@ -139,9 -133,8 +139,9 @@@ static void clean_dcache_range_nopatch(
  	} while (cur += d_size, cur < end);
  }
  
- static void __nocfi __apply_alternatives(const struct alt_region *region,
- 					 bool is_module,
- 					 unsigned long *feature_mask)
 -static void __apply_alternatives(struct alt_region *region, bool is_module,
++static void __apply_alternatives(const struct alt_region *region,
++				 bool is_module,
+ 				 unsigned long *feature_mask)
  {
  	struct alt_instr *alt;
  	__le32 *origptr, *updptr;

^ permalink raw reply	[flat|nested] 9+ messages in thread

* linux-next: manual merge of the kspp tree with the arm64 tree
@ 2021-04-26  0:34 Stephen Rothwell
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Rothwell @ 2021-04-26  0:34 UTC (permalink / raw)
  To: Kees Cook, Catalin Marinas, Will Deacon
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Mark Rutland,
	Sami Tolvanen

[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]

Hi all,

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

  arch/arm64/kernel/alternative.c

between commit:

  8d144746ecc5 ("arm64: alternative: simplify passing alt_region")

from the arm64 tree and commit:

  9562f3dc6f50 ("arm64: add __nocfi to __apply_alternatives")

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/kernel/alternative.c
index f6fd16185040,abc84636af07..000000000000
--- a/arch/arm64/kernel/alternative.c
+++ b/arch/arm64/kernel/alternative.c
@@@ -133,10 -133,11 +133,10 @@@ static void clean_dcache_range_nopatch(
  	} while (cur += d_size, cur < end);
  }
  
- static void __apply_alternatives(struct alt_region *region, bool is_module,
- 				 unsigned long *feature_mask)
 -static void __nocfi __apply_alternatives(void *alt_region,  bool is_module,
++static void __nocfi __apply_alternatives(struct alt_region *region, bool is_module,
+ 					 unsigned long *feature_mask)
  {
  	struct alt_instr *alt;
 -	struct alt_region *region = alt_region;
  	__le32 *origptr, *updptr;
  	alternative_cb_t alt_cb;
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: manual merge of the kspp tree with the arm64 tree
  2016-07-18  5:06   ` Stephen Rothwell
@ 2016-07-18  5:14     ` Kees Cook
  0 siblings, 0 replies; 9+ messages in thread
From: Kees Cook @ 2016-07-18  5:14 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Catalin Marinas, Linux-Next, LKML, Yang Shi

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: manual merge of the kspp tree with the arm64 tree
  2016-07-18  4:49 ` Kees Cook
@ 2016-07-18  5:06   ` Stephen Rothwell
  2016-07-18  5:14     ` Kees Cook
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Rothwell @ 2016-07-18  5:06 UTC (permalink / raw)
  To: Kees Cook; +Cc: Catalin Marinas, Linux-Next, LKML, Yang Shi

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: linux-next: manual merge of the kspp tree with the arm64 tree
  2016-07-18  2:59 Stephen Rothwell
@ 2016-07-18  4:49 ` Kees Cook
  2016-07-18  5:06   ` Stephen Rothwell
  0 siblings, 1 reply; 9+ messages in thread
From: Kees Cook @ 2016-07-18  4:49 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Catalin Marinas, Linux-Next, LKML, Yang Shi

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* linux-next: manual merge of the kspp tree with the arm64 tree
@ 2016-07-18  2:59 Stephen Rothwell
  2016-07-18  4:49 ` Kees Cook
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Rothwell @ 2016-07-18  2:59 UTC (permalink / raw)
  To: Kees Cook, Catalin Marinas; +Cc: linux-next, linux-kernel, Yang Shi

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)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-10-05  0:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-21  2:34 linux-next: manual merge of the kspp tree with the arm64 tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2022-09-27 18:59 broonie
2022-09-27 19:28 ` Kees Cook
2022-10-05  0:22 ` Stephen Rothwell
2021-04-26  0:34 Stephen Rothwell
2016-07-18  2:59 Stephen Rothwell
2016-07-18  4:49 ` Kees Cook
2016-07-18  5:06   ` Stephen Rothwell
2016-07-18  5:14     ` Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.