Re: gnumach RPC: get info about the calling task

2021-10-24 Thread Joan Lledó
Hi, I wrote a patch with the RPC as you guys asked. Please tell me if it fits your plans for mremap()

Re: gnumach RPC: get info about the calling task

2021-10-17 Thread Joan Lledó
El 17/10/21 a les 18:32, Samuel Thibault ha escrit> It will be useful to implement mremap with the same call. In your case you know the size, don't you? Yes That's almost the same, isn't it? (there is just the max_prot parameter, which you can indeed add to the RPC above). It's similar b

Re: gnumach RPC: get info about the calling task

2021-10-17 Thread Samuel Thibault
Sergey Bugaev, le dim. 17 oct. 2021 22:10:38 +0300, a ecrit: > On Sun, Oct 17, 2021 at 6:41 PM Joan Lledó wrote: > > Why the "size" parameter? I'd rather see a new wrapper for > > memory_object_create_proxy() which receives the same params but with the > > address instead of the original pager, wh

Re: gnumach RPC: get info about the calling task

2021-10-17 Thread Sergey Bugaev
On Sun, Oct 17, 2021 at 6:41 PM Joan Lledó wrote: > Why the "size" parameter? I'd rather see a new wrapper for > memory_object_create_proxy() which receives the same params but with the > address instead of the original pager, which internally gets the pager > from the address and calls memory_obj

Re: gnumach RPC: get info about the calling task

2021-10-17 Thread Samuel Thibault
Joan Lledó, le dim. 17 oct. 2021 17:41:11 +0200, a ecrit: > El 16/10/21 a les 13:27, Sergey Bugaev ha escrit: > > routine vm_make_proxy ( > > target_task : vm_task_t; > > address : vm_address_t; > > size : vm_size_t; > > out proxy : memory_object_t); > > Why the "size" paramete

Re: gnumach RPC: get info about the calling task

2021-10-17 Thread Joan Lledó
Hi, El 16/10/21 a les 13:27, Sergey Bugaev ha escrit: routine vm_make_proxy ( target_task : vm_task_t; address : vm_address_t; size : vm_size_t; out proxy : memory_object_t); Why the "size" parameter? I'd rather see a new wrapper for memory_object_create_proxy() which re

Re: gnumach RPC: get info about the calling task

2021-10-16 Thread Joan Lledó
OK, I'll try with your design El 16/10/21 a les 18:06, Sergey Bugaev ha escrit: On Sat, Oct 16, 2021 at 6:54 PM Samuel Thibault wrote: Indeed, since it's the region that remembers which protection was allowed, we need a proxy there to enforce them. Right, that's also a good point. max_proect

Re: gnumach RPC: get info about the calling task

2021-10-16 Thread Sergey Bugaev
On Sat, Oct 16, 2021 at 6:54 PM Samuel Thibault wrote: > Indeed, since it's the region that remembers which protection was > allowed, we need a proxy there to enforce them. Right, that's also a good point. max_proection can be less than 7 even if there never was a proxy. That is, one can do vm_m

Re: gnumach RPC: get info about the calling task

2021-10-16 Thread Samuel Thibault
Sergey Bugaev, le sam. 16 oct. 2021 14:27:01 +0300, a ecrit: > On Sat, Oct 16, 2021 at 12:38 PM Joan Lledó 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 t

Re: gnumach RPC: get info about the calling task

2021-10-16 Thread Sergey Bugaev
On Sat, Oct 16, 2021 at 2:27 PM Sergey Bugaev wrote: > 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. I also think there's a philosophical difference in

Re: gnumach RPC: get info about the calling task

2021-10-16 Thread Sergey Bugaev
Hello! On Sat, Oct 16, 2021 at 12:38 PM Joan Lledó 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 > t

Re: gnumach RPC: get info about the calling task

2021-10-16 Thread Joan Lledó
El 12/10/21 a les 20:32, Samuel Thibault ha escrit: > Sergey Bugaev, le mar. 12 oct. 2021 16:22:48 +0300, a ecrit: >> So in the case of vm_map-backed pager, it should matter whether you >> have a task port to the target task, not whether you *are* the target >> task. If someone has a task port to a

Re: gnumach RPC: get info about the calling task

2021-10-12 Thread Samuel Thibault
Sergey Bugaev, le mar. 12 oct. 2021 16:22:48 +0300, a ecrit: > So in the case of vm_map-backed pager, it should matter whether you > have a task port to the target task, not whether you *are* the target > task. If someone has a task port to a task, it allows them to > completely control the task an

Re: gnumach RPC: get info about the calling task

2021-10-12 Thread Sergey Bugaev
On Tue, Oct 12, 2021 at 3:37 PM Joan Lledó wrote: > Hi, > > I'm working on the gnumach rpc to return a pager from a task and an > address mapped in that task. Cool! What's the RPC signature? > For security reasons I'd like to check if the calling task is the same > as the one the given map belon

gnumach RPC: get info about the calling task

2021-10-12 Thread Joan Lledó
Hi, I'm working on the gnumach rpc to return a pager from a task and an address mapped in that task. For security reasons I'd like to check if the calling task is the same as the one the given map belongs to. But I don't know how to do it. In the rpc implementation, the function receives a