mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-16 22:28:18 +00:00
nova: revoke set portal id right
Revoke the right to set the portal id (aka label) when it is not needed anymore. Otherwise everybody in the system having a mapping of the portal can reset the label to something we don't expect. Issue #667
This commit is contained in:
committed by
Norman Feske
parent
46447d531e
commit
801d09f166
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* \brief Client-side CAP session interface
|
||||
* \author Norman Feske
|
||||
* \author Alexander Boettcher
|
||||
* \date 2006-07-10
|
||||
*/
|
||||
|
||||
@ -28,7 +29,17 @@ namespace Genode {
|
||||
Native_capability alloc(Native_capability ep, addr_t entry = 0,
|
||||
addr_t flags = 0)
|
||||
{
|
||||
return call<Rpc_alloc>(ep, entry, flags);
|
||||
Native_capability cap = call<Rpc_alloc>(ep, entry, flags);
|
||||
|
||||
using namespace Nova;
|
||||
|
||||
/* set our local name */
|
||||
if (NOVA_OK != pt_ctrl(cap.local_name(), cap.local_name()))
|
||||
nova_die();
|
||||
/* disable the feature for security reasons now */
|
||||
revoke(Obj_crd(cap.local_name(), 0, Obj_crd::RIGHT_PT_CTRL));
|
||||
|
||||
return cap;
|
||||
}
|
||||
|
||||
void free(Native_capability cap) { call<Rpc_free>(cap); }
|
||||
|
Reference in New Issue
Block a user