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

From: Andrey Ryabinin
Date: Mon Aug 19 2019 - 13:25:00 EST




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.wu@xxxxxxxxxxxx/
> [2] https://lore.kernel.org/linux-arm-kernel/20190819132347.GB9927@xxxxxxxxxxxxxxxxxxxxxxxxx/
>
> Signed-off-by: Mark Rutland <mark.rutland@xxxxxxx>
> Reviewed-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
> Tested-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
> Cc: Alexander Potapenko <glider@xxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>
> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
> Cc: Will Deacon <will.deacon@xxxxxxx>
> ---


Acked-by: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>