[v13,7/7] kasan: don't run tests in async mode
diff mbox series

Message ID 20210211153353.29094-8-vincenzo.frascino@arm.com
State New, archived
Headers show
Series
  • arm64: ARMv8.5-A: MTE: Add async mode support
Related show

Commit Message

Vincenzo Frascino Feb. 11, 2021, 3:33 p.m. UTC
From: Andrey Konovalov <andreyknvl@google.com>

Asynchronous KASAN mode doesn't guarantee that a tag fault will be
detected immediately and causes tests to fail. Forbid running them
in asynchronous mode.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
 lib/test_kasan.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

kernel test robot Feb. 12, 2021, 12:49 a.m. UTC | #1
Hi Vincenzo,

I love your patch! Yet something to improve:

[auto build test ERROR on next-20210211]
[cannot apply to arm64/for-next/core xlnx/master arm/for-next soc/for-next kvmarm/next linus/master hnaz-linux-mm/master v5.11-rc7 v5.11-rc6 v5.11-rc5 v5.11-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Vincenzo-Frascino/arm64-ARMv8-5-A-MTE-Add-async-mode-support/20210212-004947
base:    671176b0016c80b3943cb5387312c886aba3308d
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/0ea84467dcc53cac5c8d4e636c4d6f24e6c58728
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Vincenzo-Frascino/arm64-ARMv8-5-A-MTE-Add-async-mode-support/20210212-004947
        git checkout 0ea84467dcc53cac5c8d4e636c4d6f24e6c58728
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   aarch64-linux-ld: mm/kasan/report.o: in function `end_report':
   report.c:(.text+0x18): undefined reference to `kasan_flag_async'
   aarch64-linux-ld: mm/kasan/report.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `kasan_flag_async' which may bind externally can not be used when making a shared object; recompile with -fPIC
   report.c:(.text+0x18): dangerous relocation: unsupported relocation
   aarch64-linux-ld: report.c:(.text+0x1c): undefined reference to `kasan_flag_async'
   aarch64-linux-ld: lib/test_kasan.o: in function `kasan_test_init':
   test_kasan.c:(.text+0xccf0): undefined reference to `kasan_flag_async'
   aarch64-linux-ld: lib/test_kasan.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `kasan_flag_async' which may bind externally can not be used when making a shared object; recompile with -fPIC
   test_kasan.c:(.text+0xccf0): dangerous relocation: unsupported relocation
>> aarch64-linux-ld: test_kasan.c:(.text+0xccfc): undefined reference to `kasan_flag_async'
   aarch64-linux-ld: test_kasan.c:(.text+0xcd04): undefined reference to `kasan_flag_async'

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Catalin Marinas Feb. 12, 2021, 5:22 p.m. UTC | #2
On Thu, Feb 11, 2021 at 03:33:53PM +0000, Vincenzo Frascino wrote:
> From: Andrey Konovalov <andreyknvl@google.com>
> 
> Asynchronous KASAN mode doesn't guarantee that a tag fault will be
> detected immediately and causes tests to fail. Forbid running them
> in asynchronous mode.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> ---
>  lib/test_kasan.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/test_kasan.c b/lib/test_kasan.c
> index f8c72d3aed64..77a60592d350 100644
> --- a/lib/test_kasan.c
> +++ b/lib/test_kasan.c
> @@ -51,6 +51,10 @@ static int kasan_test_init(struct kunit *test)
>  		kunit_err(test, "can't run KASAN tests with KASAN disabled");
>  		return -1;
>  	}
> +	if (kasan_flag_async) {
> +		kunit_err(test, "can't run KASAN tests in async mode");
> +		return -1;
> +	}

I think we have time to fix this properly ;), so I'd rather not add this
patch at all.
Andrey Konovalov Feb. 12, 2021, 9:44 p.m. UTC | #3
On Fri, Feb 12, 2021 at 6:22 PM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Thu, Feb 11, 2021 at 03:33:53PM +0000, Vincenzo Frascino wrote:
> > From: Andrey Konovalov <andreyknvl@google.com>
> >
> > Asynchronous KASAN mode doesn't guarantee that a tag fault will be
> > detected immediately and causes tests to fail. Forbid running them
> > in asynchronous mode.
> >
> > Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> > Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> > ---
> >  lib/test_kasan.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/lib/test_kasan.c b/lib/test_kasan.c
> > index f8c72d3aed64..77a60592d350 100644
> > --- a/lib/test_kasan.c
> > +++ b/lib/test_kasan.c
> > @@ -51,6 +51,10 @@ static int kasan_test_init(struct kunit *test)
> >               kunit_err(test, "can't run KASAN tests with KASAN disabled");
> >               return -1;
> >       }
> > +     if (kasan_flag_async) {
> > +             kunit_err(test, "can't run KASAN tests in async mode");
> > +             return -1;
> > +     }
>
> I think we have time to fix this properly ;), so I'd rather not add this
> patch at all.

Yeah, this patch can be dropped.

I have a prototype of async support for tests working. I'll apply it
on top of the next version Vincenzo posts and share the patch.

Vincenzo, when you post the next version, please make sure you rebase
on top of the mm tree version that includes "kasan: export HW_TAGS
symbols for KUnit tests" (linux-next/akpm doesn't yet have it).
Vincenzo Frascino Feb. 22, 2021, 11:17 a.m. UTC | #4
On 2/12/21 9:44 PM, Andrey Konovalov wrote:
>> I think we have time to fix this properly ;), so I'd rather not add this
>> patch at all.
> Yeah, this patch can be dropped.
> 
> I have a prototype of async support for tests working. I'll apply it
> on top of the next version Vincenzo posts and share the patch.
> 
> Vincenzo, when you post the next version, please make sure you rebase
> on top of the mm tree version that includes "kasan: export HW_TAGS
> symbols for KUnit tests" (linux-next/akpm doesn't yet have it).

Fine by me, I will drop this patch when I will repost in -rc1.

@Andrey: If you want me to test the series all together, you can send me your
tree before I repost and then I can send the patches as single series. What do
you think?
Andrey Konovalov Feb. 22, 2021, 1:35 p.m. UTC | #5
On Mon, Feb 22, 2021 at 12:13 PM Vincenzo Frascino
<vincenzo.frascino@arm.com> wrote:
>
> On 2/12/21 9:44 PM, Andrey Konovalov wrote:
> >> I think we have time to fix this properly ;), so I'd rather not add this
> >> patch at all.
> > Yeah, this patch can be dropped.
> >
> > I have a prototype of async support for tests working. I'll apply it
> > on top of the next version Vincenzo posts and share the patch.
> >
> > Vincenzo, when you post the next version, please make sure you rebase
> > on top of the mm tree version that includes "kasan: export HW_TAGS
> > symbols for KUnit tests" (linux-next/akpm doesn't yet have it).
>
> Fine by me, I will drop this patch when I will repost in -rc1.
>
> @Andrey: If you want me to test the series all together, you can send me your
> tree before I repost and then I can send the patches as single series. What do
> you think?

I'll need a rebased version of your patches first, otherwise conflicts
will be a pain.

Thanks!

Patch
diff mbox series

diff --git a/lib/test_kasan.c b/lib/test_kasan.c
index f8c72d3aed64..77a60592d350 100644
--- a/lib/test_kasan.c
+++ b/lib/test_kasan.c
@@ -51,6 +51,10 @@  static int kasan_test_init(struct kunit *test)
 		kunit_err(test, "can't run KASAN tests with KASAN disabled");
 		return -1;
 	}
+	if (kasan_flag_async) {
+		kunit_err(test, "can't run KASAN tests in async mode");
+		return -1;
+	}
 
 	multishot = kasan_save_enable_multi_shot();
 	hw_set_tagging_report_once(false);