Re: [PATCH] mm: export copy_to_kernel_nofault
From: Marco Elver
Date: Wed Oct 23 2024 - 02:57:56 EST
On Wed, 23 Oct 2024 at 08:53, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> On Fri, Oct 18, 2024 at 03:11:09PM +0000, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@xxxxxxxx>
> >
> > This symbol is now used on the kasan test module, so it needs to be
> > exported.
> >
> > ERROR: modpost: "copy_to_kernel_nofault" [mm/kasan/kasan_test.ko] undefined!
>
> Meh, it would be great not to export internal helpers just because
> someone wants to test them. Please just mark that test built-in only
> instead.
We have EXPORT_SYMBOL_IF_KUNIT. See include/kunit/visibility.h -
that's more appropriate, and also adjust kasan_test.c to do
MODULE_IMPORT_NS(EXPORTED_FOR_KUNIT_TESTING).