Currently, building KASAN-KUnit tests as a module fails with:
ERROR: modpost: "mte_enable_kernel" [lib/test_kasan.ko] undefined!
ERROR: modpost: "mte_set_report_once" [lib/test_kasan.ko] undefined!
This change adds KASAN wrappers for mte_enable_kernel() and
mte_set_report_once() and only defines and exports them when KASAN-KUnit
tests are enabled.
The wrappers aren't defined when tests aren't enabled to avoid misuse.
The mte_() functions aren't exported directly to avoid having low-level
KASAN ifdefs in the arch code.
Signed-off-by: Andrey Konovalov <redacted>
---
Changes v1->v2:
- Add wrappers instead of exporting MTE symbols directly.
- Only define and export wrappers when KASAN-KUnit tests are enabled.
---
lib/test_kasan.c | 6 +++---
mm/kasan/hw_tags.c | 16 ++++++++++++++++
mm/kasan/kasan.h | 12 ++++++++++++
3 files changed, 31 insertions(+), 3 deletions(-)
From: Andrew Morton <akpm@linux-foundation.org> Date: 2021-02-12 20:17:04
On Fri, 12 Feb 2021 21:08:52 +0100 Andrey Konovalov [off-list ref] wrote:
Currently, building KASAN-KUnit tests as a module fails with:
ERROR: modpost: "mte_enable_kernel" [lib/test_kasan.ko] undefined!
ERROR: modpost: "mte_set_report_once" [lib/test_kasan.ko] undefined!
This change adds KASAN wrappers for mte_enable_kernel() and
mte_set_report_once() and only defines and exports them when KASAN-KUnit
tests are enabled.
The wrappers aren't defined when tests aren't enabled to avoid misuse.
The mte_() functions aren't exported directly to avoid having low-level
KASAN ifdefs in the arch code.
Please confirm that this is applicable to current Linus mainline?
Today is pretty much the last day for getting material into 5.11, and
this patch has been churning somewhat.
So I think it would be better to merge this into 5.12-rc1, with a
cc:stable so it goes into 5.11.1.
For which we'll need a Fixes:, please?
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Fri, Feb 12, 2021 at 9:16 PM Andrew Morton [off-list ref] wrote:
On Fri, 12 Feb 2021 21:08:52 +0100 Andrey Konovalov [off-list ref] wrote:
quoted
Currently, building KASAN-KUnit tests as a module fails with:
ERROR: modpost: "mte_enable_kernel" [lib/test_kasan.ko] undefined!
ERROR: modpost: "mte_set_report_once" [lib/test_kasan.ko] undefined!
This change adds KASAN wrappers for mte_enable_kernel() and
mte_set_report_once() and only defines and exports them when KASAN-KUnit
tests are enabled.
The wrappers aren't defined when tests aren't enabled to avoid misuse.
The mte_() functions aren't exported directly to avoid having low-level
KASAN ifdefs in the arch code.
Please confirm that this is applicable to current Linus mainline?
It's not applicable. KUnit tests for HW_TAGS aren't supported there,
the patches for that are in mm only. So no need to put it into 5.11.
Today is pretty much the last day for getting material into 5.11, and
this patch has been churning somewhat.
So I think it would be better to merge this into 5.12-rc1, with a
cc:stable so it goes into 5.11.1.
For which we'll need a Fixes:, please?
--
You received this message because you are subscribed to the Google Groups "kasan-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/20210212121610.ff05a7bb37f97caef97dc924%40linux-foundation.org.
From: Andrew Morton <akpm@linux-foundation.org> Date: 2021-02-12 20:55:40
On Fri, 12 Feb 2021 21:21:39 +0100 Andrey Konovalov [off-list ref] wrote:
quoted
quoted
The wrappers aren't defined when tests aren't enabled to avoid misuse.
The mte_() functions aren't exported directly to avoid having low-level
KASAN ifdefs in the arch code.
Please confirm that this is applicable to current Linus mainline?
It's not applicable. KUnit tests for HW_TAGS aren't supported there,
the patches for that are in mm only. So no need to put it into 5.11.
On Fri, Feb 12, 2021 at 9:54 PM Andrew Morton [off-list ref] wrote:
On Fri, 12 Feb 2021 21:21:39 +0100 Andrey Konovalov [off-list ref] wrote:
quoted
quoted
quoted
The wrappers aren't defined when tests aren't enabled to avoid misuse.
The mte_() functions aren't exported directly to avoid having low-level
KASAN ifdefs in the arch code.
Please confirm that this is applicable to current Linus mainline?
It's not applicable. KUnit tests for HW_TAGS aren't supported there,
the patches for that are in mm only. So no need to put it into 5.11.
So... which -mm patch does this patch fix?
"kasan, arm64: allow using KUnit tests with HW_TAGS mode".
There will be some minor adjacent-line-changed conflicts if you decide
to squash it.
Alternatively, this can go as a separate patch after the tests series
(after "kasan: don't run tests when KASAN is not enabled").
Thanks!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Andrew Morton <akpm@linux-foundation.org> Date: 2021-02-12 21:09:18
On Fri, 12 Feb 2021 22:01:38 +0100 Andrey Konovalov [off-list ref] wrote:
On Fri, Feb 12, 2021 at 9:54 PM Andrew Morton [off-list ref] wrote:
quoted
On Fri, 12 Feb 2021 21:21:39 +0100 Andrey Konovalov [off-list ref] wrote:
quoted
quoted
quoted
The wrappers aren't defined when tests aren't enabled to avoid misuse.
The mte_() functions aren't exported directly to avoid having low-level
KASAN ifdefs in the arch code.
Please confirm that this is applicable to current Linus mainline?
It's not applicable. KUnit tests for HW_TAGS aren't supported there,
the patches for that are in mm only. So no need to put it into 5.11.
So... which -mm patch does this patch fix?
"kasan, arm64: allow using KUnit tests with HW_TAGS mode".
There will be some minor adjacent-line-changed conflicts if you decide
to squash it.
Alternatively, this can go as a separate patch after the tests series
(after "kasan: don't run tests when KASAN is not enabled").
Thanks - it wasn't obvious.
I staged it as a fix against "kasan, arm64: allow using KUnit tests
with HW_TAGS mode". To make the series as nice as we can, and to avoid
bisection holes.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Fri, Feb 12, 2021 at 10:08 PM Andrew Morton
[off-list ref] wrote:
On Fri, 12 Feb 2021 22:01:38 +0100 Andrey Konovalov [off-list ref] wrote:
quoted
On Fri, Feb 12, 2021 at 9:54 PM Andrew Morton [off-list ref] wrote:
quoted
On Fri, 12 Feb 2021 21:21:39 +0100 Andrey Konovalov [off-list ref] wrote:
quoted
quoted
quoted
The wrappers aren't defined when tests aren't enabled to avoid misuse.
The mte_() functions aren't exported directly to avoid having low-level
KASAN ifdefs in the arch code.
Please confirm that this is applicable to current Linus mainline?
It's not applicable. KUnit tests for HW_TAGS aren't supported there,
the patches for that are in mm only. So no need to put it into 5.11.
So... which -mm patch does this patch fix?
"kasan, arm64: allow using KUnit tests with HW_TAGS mode".
There will be some minor adjacent-line-changed conflicts if you decide
to squash it.
Alternatively, this can go as a separate patch after the tests series
(after "kasan: don't run tests when KASAN is not enabled").
Thanks - it wasn't obvious.
I staged it as a fix against "kasan, arm64: allow using KUnit tests
with HW_TAGS mode". To make the series as nice as we can, and to avoid
bisection holes.