How about allowing processes to expose memory for cross memory attaching?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

A major limitation of process_vm_writev and process_vm_readv is that
they have the same permission constraints as ptrace. How about allowing
processes to expose memory for reading with process_vm_readv or
writing with process_vm_writev?

I think a good way of doing this might be to add flags to
process_vm_writev and process_vm_readv to make them temporarily
publish a vector of memory to another process until such memory is
read or written from with process_vm_writev or process_vm_readv once.
For example, one would invoke the process_vm functionality like so to
publish for reading the vector of memory in local_iov to the process
identified by pid:

if (-1 == process_vm_writev(pid,
                           local_iov, ARRAY_SIZE(local_iov),
                           NULL, 0,
                           PROC_VM_PUBLISH)) { // ...

The interface would be simpler if the functions blocked but then for
every EINTR handling loop there would need to be an EPERM loop on the
other side.

Finally, I'm not sure of what the semantics of that interface would be
in the presence of multithreading or shared memory. And, I'm not sure
how usable this interface would be for fast message passing which is
the whole intent of the process_vm functions (I'm using these
functions directly for my application and this interface seems like it
work fine with my application but I'm not sure it would work for
message passing libraries in general).

Thank you,
Steven Stewart-Gallus
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux