Re: [PATCHv2] lib/test_kasan: add roundtrip tests

2019-08-24 Thread Andrew Morton
On Fri, 23 Aug 2019 11:41:08 +0100 Mark Rutland  wrote:

> >  
> >  /*
> > 
> > which is really kinda wrong.  We should strictly include linux/io.h for
> > things like virt_to_phys().
> > 
> > So I think I'll stick with v1 plus my fixlet:
> > 
> > --- a/lib/test_kasan.c~lib-test_kasan-add-roundtrip-tests-checkpatch-fixes
> > +++ a/lib/test_kasan.c
> > @@ -18,8 +18,8 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  
> > -#include 
> >  #include 
> >  
> >  /*
> > 
> 
> Assuming that you mean *v3* with that fix, that looks good to me!

Yes, that's what we have.


Re: [PATCHv2] lib/test_kasan: add roundtrip tests

2019-08-23 Thread Mark Rutland
Hi Andrew,

On Thu, Aug 22, 2019 at 04:48:57PM -0700, Andrew Morton wrote:
> On Mon, 19 Aug 2019 17:14:49 +0100 Mark Rutland  wrote:
> 
> > In several places we need to be able to operate on pointers which have
> > gone via a roundtrip:
> > 
> > virt -> {phys,page} -> virt
> > 
> > With KASAN_SW_TAGS, we can't preserve the tag for SLUB objects, and the
> > {phys,page} -> virt conversion will use KASAN_TAG_KERNEL.
> > 
> > This patch adds tests to ensure that this works as expected, without
> > false positives which have recently been spotted [1,2] in testing.
> > 
> > [1] 
> > https://lore.kernel.org/linux-arm-kernel/20190819114420.2535-1-walter-zh...@mediatek.com/
> > [2] 
> > https://lore.kernel.org/linux-arm-kernel/20190819132347.gb9...@lakrids.cambridge.arm.com/
> > 
> >
> > ...
> >
> 
> The only change I'm seeing from v1 is:
> 
> --- a/lib/test_kasan.c~lib-test_kasan-add-roundtrip-tests-v2
> +++ a/lib/test_kasan.c
> @@ -19,7 +19,6 @@
>  #include 
>  #include 
>  
> -#include 
>  #include 

I think you've confused v1 with v3 (which was the first version to
include ).

v1: 
https://lore.kernel.org/linux-arm-kernel/20190819150341.gc9...@lakrids.cambridge.arm.com/
v3: 
https://lore.kernel.org/linux-arm-kernel/20190819150341.gc9...@lakrids.cambridge.arm.com/

I guess as v1 was part of a reply (without the mail subject matching)
that might have confused things? Sorry about that if so!

>  
>  /*
> 
> which is really kinda wrong.  We should strictly include linux/io.h for
> things like virt_to_phys().
> 
> So I think I'll stick with v1 plus my fixlet:
> 
> --- a/lib/test_kasan.c~lib-test_kasan-add-roundtrip-tests-checkpatch-fixes
> +++ a/lib/test_kasan.c
> @@ -18,8 +18,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
> -#include 
>  #include 
>  
>  /*
> 

Assuming that you mean *v3* with that fix, that looks good to me!

Thanks,
Mark.


Re: [PATCHv2] lib/test_kasan: add roundtrip tests

2019-08-22 Thread Andrew Morton
On Mon, 19 Aug 2019 17:14:49 +0100 Mark Rutland  wrote:

> In several places we need to be able to operate on pointers which have
> gone via a roundtrip:
> 
>   virt -> {phys,page} -> virt
> 
> With KASAN_SW_TAGS, we can't preserve the tag for SLUB objects, and the
> {phys,page} -> virt conversion will use KASAN_TAG_KERNEL.
> 
> This patch adds tests to ensure that this works as expected, without
> false positives which have recently been spotted [1,2] in testing.
> 
> [1] 
> https://lore.kernel.org/linux-arm-kernel/20190819114420.2535-1-walter-zh...@mediatek.com/
> [2] 
> https://lore.kernel.org/linux-arm-kernel/20190819132347.gb9...@lakrids.cambridge.arm.com/
> 
>
> ...
>

The only change I'm seeing from v1 is:

--- a/lib/test_kasan.c~lib-test_kasan-add-roundtrip-tests-v2
+++ a/lib/test_kasan.c
@@ -19,7 +19,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 /*

which is really kinda wrong.  We should strictly include linux/io.h for
things like virt_to_phys().

So I think I'll stick with v1 plus my fixlet:

--- a/lib/test_kasan.c~lib-test_kasan-add-roundtrip-tests-checkpatch-fixes
+++ a/lib/test_kasan.c
@@ -18,8 +18,8 @@
 #include 
 #include 
 #include 
+#include 
 
-#include 
 #include 
 
 /*

> Since v1:
> * Spin as a separate patch
> * Fix typo
> * Note examples in commit message.

So I'm not sure what happened to these things.  Did you send the correct
patch?



Re: [PATCHv2] lib/test_kasan: add roundtrip tests

2019-08-19 Thread Andrey Ryabinin



On 8/19/19 7:14 PM, Mark Rutland wrote:
> In several places we need to be able to operate on pointers which have
> gone via a roundtrip:
> 
>   virt -> {phys,page} -> virt
> 
> With KASAN_SW_TAGS, we can't preserve the tag for SLUB objects, and the
> {phys,page} -> virt conversion will use KASAN_TAG_KERNEL.
> 
> This patch adds tests to ensure that this works as expected, without
> false positives which have recently been spotted [1,2] in testing.
> 
> [1] 
> https://lore.kernel.org/linux-arm-kernel/20190819114420.2535-1-walter-zh...@mediatek.com/
> [2] 
> https://lore.kernel.org/linux-arm-kernel/20190819132347.gb9...@lakrids.cambridge.arm.com/
> 
> Signed-off-by: Mark Rutland 
> Reviewed-by: Andrey Konovalov 
> Tested-by: Andrey Konovalov 
> Cc: Alexander Potapenko 
> Cc: Andrew Morton 
> Cc: Andrey Ryabinin 
> Cc: Dmitry Vyukov 
> Cc: Will Deacon 
> ---


Acked-by: Andrey Ryabinin