lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210209170255.GG1435@arm.com>
Date:   Tue, 9 Feb 2021 17:02:56 +0000
From:   Catalin Marinas <catalin.marinas@....com>
To:     Andrey Konovalov <andreyknvl@...gle.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Vincenzo Frascino <vincenzo.frascino@....com>,
        Will Deacon <will.deacon@....com>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>,
        Alexander Potapenko <glider@...gle.com>,
        Marco Elver <elver@...gle.com>,
        Peter Collingbourne <pcc@...gle.com>,
        Evgenii Stepanov <eugenis@...gle.com>,
        Branislav Rankov <Branislav.Rankov@....com>,
        Kevin Brodsky <kevin.brodsky@....com>,
        Christoph Hellwig <hch@...radead.org>,
        kasan-dev@...glegroups.com, linux-arm-kernel@...ts.infradead.org,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH mm] arm64: kasan: fix MTE symbols exports

On Tue, Feb 09, 2021 at 04:32:30PM +0100, Andrey Konovalov wrote:
> diff --git a/arch/arm64/kernel/mte.c b/arch/arm64/kernel/mte.c
> index a66c2806fc4d..788ef0c3a25e 100644
> --- a/arch/arm64/kernel/mte.c
> +++ b/arch/arm64/kernel/mte.c
> @@ -113,13 +113,17 @@ void mte_enable_kernel(void)
>  	sysreg_clear_set(sctlr_el1, SCTLR_ELx_TCF_MASK, SCTLR_ELx_TCF_SYNC);
>  	isb();
>  }
> +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST)
>  EXPORT_SYMBOL_GPL(mte_enable_kernel);
> +#endif
>  
>  void mte_set_report_once(bool state)
>  {
>  	WRITE_ONCE(report_fault_once, state);
>  }
> +#if IS_ENABLED(CONFIG_KASAN_KUNIT_TEST)
>  EXPORT_SYMBOL_GPL(mte_set_report_once);
> +#endif

Do we actually care about exporting them when KASAN_KUNIT_TEST=n? It
looks weird to have these #ifdefs in the arch code. Either the
arch-kasan API requires these symbols to be exported to modules or not.
I'm not keen on such kasan internals trickling down into the arch code.

If you don't want to export them in the KASAN_KUNIT_TEST=n case, add a
wrapper in the kasan built-in code (e.g. kasan_test_enable_tagging,
kasan_test_set_report_once) and conditionally compile them based on
KASAN_KUNIT_TEST.

-- 
Catalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ