[PATCH 3/3] arm64: kasan: mte: remove redundant mte_report_once logic

Andrey Konovalov andreyknvl at gmail.com
Mon Aug 2 04:52:09 PDT 2021


On Sat, Jul 31, 2021 at 1:49 PM Catalin Marinas <catalin.marinas at arm.com> wrote:
>
> > > Because kasan has its own mechanism with KASAN_BIT_REPORTED.
> >
> > This mechanism only works when multi_shot is disabled. But milti_shot
> > is always enabled when running the tests. Yet I tested the series, and
> > I don't see multiple reports for each test, so everything somehow
> > works. But I don't understand how.
>
> When running tests, "reported" variable update is also disabled, so it
> wouldn't make any difference.
>
> When a fault happens in synchronous mode, to be able to continue safely
> the tag checking is disabled on the current CPU (and lazily on the other
> CPUs). So you won't be able to get another report on that CPU anyway. In
> the unlikely event that the test thread migrates to another CPU before
> completion, it may trigger another tag check fault on the new CPU and a
> report.
>
> We probably don't see multiple reports during a single test because (a)
> kasan tests have preemption disabled, (b) they are unlikely to migrate
> during the short time they run or (c) the kasan tests only do a single
> faulty access.

I've got a feeling there was some other reason for this "reported"
check, but I don't remember what that was. Maybe this was related to a
bug in the earlier version of the MTE patches.

Anyway, the code looks good and the tests work for me as expected, so:

Reviewed-by: Andrey Konovalov <andreyknvl at gmail.com>
Tested-by: Andrey Konovalov <andreyknvl at gmail.com>

Thanks!



More information about the linux-arm-kernel mailing list