[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6cc5e12d-1492-d9b7-3ea7-6381407439d7@virtuozzo.com>
Date: Thu, 13 Jun 2019 15:50:06 +0300
From: Andrey Ryabinin <aryabinin@...tuozzo.com>
To: Marco Elver <elver@...gle.com>, peterz@...radead.org,
dvyukov@...gle.com, glider@...gle.com, andreyknvl@...gle.com,
mark.rutland@....com, hpa@...or.com
Cc: corbet@....net, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
x86@...nel.org, arnd@...db.de, jpoimboe@...hat.com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org, kasan-dev@...glegroups.com
Subject: Re: [PATCH v4 1/3] lib/test_kasan: Add bitops tests
On 6/13/19 3:30 PM, Marco Elver wrote:
> This adds bitops tests to the test_kasan module. In a follow-up patch,
> support for bitops instrumentation will be added.
>
> Signed-off-by: Marco Elver <elver@...gle.com>
> Acked-by: Mark Rutland <mark.rutland@....com>
> ---
Reviewed-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
> +static noinline void __init kasan_bitops(void)
> +{
> + /*
> + * Allocate 1 more byte, which causes kzalloc to round up to 16-bytes;
> + * this way we do not actually corrupt other memory, in case
> + * instrumentation is not working as intended.
This sound like working instrumentation somehow save us from corrupting memory. In fact it doesn't,
it only reports corruption.
> + */
> + long *bits = kzalloc(sizeof(*bits) + 1, GFP_KERNEL);
> + if (!bits)
> + return;
> +
Powered by blists - more mailing lists