userspace: don't adjust perms on object init
We got rid of letting uninitialized objects being a free-for-all and permission to do stuff on an object is now done explicitly. If a user thread is initializing an object, they will already have permission on it. If a supervisor thread is initializing an object, that supervisor thread may or may not want that object added to its set of object permissions for purposes of permission inheritance or dropping to user mode. Resetting all permissions on initialization makes objects much harder to share and re-use; for example other threads will lose access if some thread re-inits a shared semaphore. For all these reasons, just keep the permissions as they are when an object is initialized. We will need some policy for permission reset when objects are requested and released from pools, but the pool implementation should take care of that. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
885fcd5147
commit
9bd5e76b47
|
@ -250,12 +250,6 @@ void _k_object_init(void *object)
|
|||
return;
|
||||
}
|
||||
|
||||
/* Initializing an object implicitly grants access to the calling
|
||||
* thread and nobody else
|
||||
*/
|
||||
memset(ko->perms, 0, CONFIG_MAX_THREAD_BYTES);
|
||||
_thread_perms_set(ko, _current);
|
||||
|
||||
/* Allows non-initialization system calls to be made on this object */
|
||||
ko->flags |= K_OBJ_FLAG_INITIALIZED;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue