bug-hurd
[Top][All Lists]
Advanced

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

Re: gnumach RPC: get info about the calling task


From: Sergey Bugaev
Subject: Re: gnumach RPC: get info about the calling task
Date: Sat, 16 Oct 2021 14:27:01 +0300

Hello!

On Sat, Oct 16, 2021 at 12:38 PM Joan Lledó <jlledom@mailfence.com> wrote:
> The new interface needs to know about proxies, and if one range has been 
> mapped using a proxy, it must return the proxy and not the original object, 
> which could be used to bypass the proxy protection, that's why I needed a way 
> to lookup for used proxies from a task and an address.

I don't think it should *ever* return the original object back. I'd
rather it always made a new proxy that internally references the
object and caps max_protection to that of the region. So,

1. Find the relevant memory region
2. Take note of its max_protection, its underlying memobj, and offset
into the memobj
3. Create a new proxy, as if with memory_object_create_proxy (), for
these memobj/offset/protection
4. Return that to the user

That would actually make the patch much simpler too.

And if we do it like that, the RPC should be named something like
vm_make_proxy (); to emphasize that it creates a new proxy. The
signature I'm thinking about is something like:

routine vm_make_proxy (
    target_task : vm_task_t;
    address : vm_address_t;
    size : vm_size_t;
    out proxy : memory_object_t);

*Possibly* with an additional deallocate_source : boolean_t to avoid
an additional vm_deallocate () RPC in the common case of mremap ()
implementation.

> I don't like that, since proxies are rarely used so rarely (if ever)

They are now used *way* more widely than you think :) But still,
requiring each and every vm_deallocate () call to look through proxies
is not very nice.

Sergey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]