linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Potapenko <glider@google.com>
To: linux-um@lists.infradead.org, richard@nod.at,
	 anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net
Subject: Building UML with ASan on x86
Date: Wed, 24 May 2023 17:46:25 +0200	[thread overview]
Message-ID: <CAG_fn=VaYdgreWwCUgrcaCDHH_54hBksvEUD4fijSzRs21ge=A@mail.gmail.com> (raw)

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

                 reply	other threads:[~2023-05-24 15:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG_fn=VaYdgreWwCUgrcaCDHH_54hBksvEUD4fijSzRs21ge=A@mail.gmail.com' \
    --to=glider@google.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-um@lists.infradead.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).