Re: [PATCH] rust: Do not export generated KASAN ODR symbols
From: Matthew Maurer
Date: Wed Feb 05 2025 - 15:08:28 EST
On Wed, Jan 22, 2025 at 1:12 AM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Wed, Jan 22, 2025 at 1:14 AM Matthew Maurer <mmaurer@xxxxxxxxxx> wrote:
> >
> > ASAN generates sppecial synthetic symbols to help check for ODR
> > violations. These synthetic symbols lack debug information, so
> > gendwarfksyms emits warnings when processing them. No code should ever
> > have a dependency on these symbols, so we should not be exporting them,
> > just like the __cfi symbols.
> >
> > Signed-off-by: Matthew Maurer <mmaurer@xxxxxxxxxx>
>
> Sounds good -- are those generated unconditionally by ASAN to check
> for C++ ODR violations and so we get them anyway or do we benefit
> somehow?
>
> I also wondered about whether we should search for an extra underscore
> (`__odr_asan_`), but I also see mentions of `__odr_asan.`, which I
> guess that is the reason you used that prefix. Is that right?
In case you were waiting for an answer on that, it's because I was
trying to be as loose as possible, since `__odr_asan` isn't going to
end up on random symbols we *intended* to export from the kernel.
We could technically restrict it to `__odr_asan_gen_` to be more
precise and it should still work.
>
> Acked-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
>
> Thanks!
>
> Cheers,
> Miguel