All of lore.kernel.org
 help / color / mirror / Atom feed
From: Derrick McKee <derrick.mckee@gmail.com>
To: Linux Memory Management List <linux-mm@kvack.org>
Cc: davem@redhat.com
Subject: Mapping two KVAs to the same page
Date: Thu, 17 Sep 2020 16:00:00 -0400	[thread overview]
Message-ID: <CAJoBWHzzD2mOepuKtd0LzjrNnjxXkxnOGx+Lj10rFKVTkZ3d7Q@mail.gmail.com> (raw)

Hi,

I am trying to make a research prototype that compartmentalizes kernel
modules.  Part of my design involves embedding an ID number in a
kernel address, which I extract when I need to check for proper
pointer access.  I've modified the module loader to place the module
in an address that contains the ID.  However, when the kernel invokes
one of the kernel API functions the module implements (e.g.,
inet6_create), I'd also like any pointer input arguments to also have
the ID embedded.  Instead of doing a deep copy of objects to an
address that I allocate, my thought is that I find a page aligned
address that contains my ID, and have that address map to the same
page as the input pointer uses.  I then can use the new address as
input to the API function.  Is this possible, and if so, how?

I have tried using __get_vm_area_caller() to get a free address in a
location I want, and then map_kernel_range() to tie the input pointer
page to the new address.  This results in a segfault in
mte_sync_tags() (called by vmap_pte_range()).  I also tried
__vmalloc_node_range() along with map_kernel_range(), but this
triggers the warning on mm/vmalloc.c:211.

Any insight is appreciated, thanks!

-- 
Derrick McKee
Phone: (703) 957-9362
Email: derrick.mckee@gmail.com


             reply	other threads:[~2020-09-17 20:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 20:00 Derrick McKee [this message]
2020-09-22 14:07 Mapping two KVAs to the same page Derrick McKee

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=CAJoBWHzzD2mOepuKtd0LzjrNnjxXkxnOGx+Lj10rFKVTkZ3d7Q@mail.gmail.com \
    --to=derrick.mckee@gmail.com \
    --cc=davem@redhat.com \
    --cc=linux-mm@kvack.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.