All of lore.kernel.org
 help / color / mirror / Atom feed
* Mapping two KVAs to the same page
@ 2020-09-22 14:07 Derrick McKee
  0 siblings, 0 replies; 2+ messages in thread
From: Derrick McKee @ 2020-09-22 14:07 UTC (permalink / raw)
  To: Linux ARM

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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Mapping two KVAs to the same page
@ 2020-09-17 20:00 Derrick McKee
  0 siblings, 0 replies; 2+ messages 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] 2+ messages in thread

end of thread, other threads:[~2020-09-22 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 14:07 Mapping two KVAs to the same page Derrick McKee
  -- strict thread matches above, loose matches on Subject: below --
2020-09-17 20:00 Derrick McKee

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.