[PATCH v2] x86: Fix build of UML with KASAN

Johannes Berg johannes at sipsolutions.net
Fri Sep 15 07:44:01 PDT 2023


On Fri, 2023-09-15 at 11:32 +0200, Ingo Molnar wrote:
> 
> >  ld: mm/kasan/shadow.o: in function `memset':
> >  shadow.c:(.text+0x40): multiple definition of `memset';
> >  arch/x86/lib/memset_64.o:(.noinstr.text+0x0): first defined here
> >  ld: mm/kasan/shadow.o: in function `memmove':
> >  shadow.c:(.text+0x90): multiple definition of `memmove';
> >  arch/x86/lib/memmove_64.o:(.noinstr.text+0x0): first defined here
> >  ld: mm/kasan/shadow.o: in function `memcpy':
> >  shadow.c:(.text+0x110): multiple definition of `memcpy';
> >  arch/x86/lib/memcpy_64.o:(.noinstr.text+0x0): first defined here
> 
> So the breakage was ~9 months ago, and apparently nobody build-tested UML?

Well, first of all, it's only with KASAN, and then I think we probably
all did and applied a similar fix or this one ... I have a in my tree
that simplies marks the three symbols as weak again, for instance,
dating back to March 27th. Didn't publish it at the time, it probably
got lost in the shuffle, don't remember.


Also, a variant of this patch has been around for three months too.

> Does UML boot with the fix?

Sure, works fine as long as the symbols are marked weak _somehow_.

johannes



More information about the linux-um mailing list