linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Building UML with ASan on x86
@ 2023-05-24 15:46 Alexander Potapenko
  0 siblings, 0 replies; only message in thread
From: Alexander Potapenko @ 2023-05-24 15:46 UTC (permalink / raw)
  To: linux-um, richard, anton.ivanov, johannes

Hi UML maintainers,

I am trying to build and run x86_64 UML with ASan (some patches to do
so are at [1]).
This is more of an experiment, but the idea behind it is that
userspace ASan should be able to instrument the whole kernel code,
while KASAN does not instrument its own building blocks (SLAB/SLUB,
stack unwinder, stackdepot).

The problem I am hitting is that by default my kernel is loaded
between 0x60000000-0x62000000, and UML attempts to allocate its
physical memory so that it starts around those addresses.
Unfortunately ASan's shadow memory on x86_64 Linux is located at
0x00007fff8000-0x10007fff8000, so if I run UML with e.g. `mem=512` the
physical memory allocated by setup_physmem() will overlap with ASan
shadow, leading to crashes.

Is there an easy way to move UML's physical memory above 0x10007fff8000?

I tried e.g. adjusting START in arch/x86/Makefile.um to
0x200060000000, but that led to boot-time vmap allocation failures.
Could it be that there are some implicit conditions on this address -
maybe something related to TASK_SIZE?

Thanks,
Alex

[1] https://github.com/ramosian-glider/linux/commits/uml-asan

_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-24 15:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-24 15:46 Building UML with ASan on x86 Alexander Potapenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).