linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Mapping two KVAs to the same page
@ 2020-09-17 20:00 Derrick McKee
  0 siblings, 0 replies; only message in thread
From: Derrick McKee @ 2020-09-17 20:00 UTC (permalink / raw)
  To: Linux Memory Management List; +Cc: davem

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


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

only message in thread, other threads:[~2020-09-17 20:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 20:00 Mapping two KVAs to the same page Derrick McKee

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).