Changeset 26a6ed4 in mainline for kernel/generic/src/ipc/ops/conctmeto.c
- Timestamp:
- 2018-03-11T07:35:05Z (7 years ago)
- Children:
- bbf38ad
- Parents:
- 813fc8c
- git-author:
- Jakub Jermar <jakub@…> (2018-03-10 18:18:12)
- git-committer:
- Jakub Jermar <jakub@…> (2018-03-11 07:35:05)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/conctmeto.c
r813fc8c r26a6ed4 42 42 static errno_t request_preprocess(call_t *call, phone_t *phone) 43 43 { 44 /* 45 * Create the new phone and capability, but don't publish them yet. 46 * That will be done once the phone is connected. 47 */ 44 48 cap_handle_t phone_handle; 45 errno_t rc = phone_alloc(TASK, &phone_handle); 49 kobject_t *phone_obj; 50 errno_t rc = phone_alloc(TASK, false, &phone_handle, &phone_obj); 46 51 if (rc != EOK) { 47 52 call->priv = -1; 48 53 return rc; 49 }50 51 /*52 * The capability is now published, but the phone is not connected yet.53 * The user cannot use it to send anything over it, in fact the54 * userspace can only unpublish and free the capability at this point.55 *56 * We now proceed to test the capability is still there. We don't care57 * if the user destroyed the old one and recreated a new published one58 * of the same type under the same handle.59 *60 * If the capability is in place we temporarily unpublish it to make61 * sure the user cannot fiddle with it while we are connecting.62 */63 64 kobject_t *phone_obj = cap_unpublish(TASK, phone_handle,65 KOBJECT_TYPE_PHONE);66 if (!phone_obj) {67 /*68 * Another thread of the same task can destroy the new69 * capability before we manage to get a reference from it.70 */71 call->priv = -1;72 return ENOENT;73 54 } 74 55
Note:
See TracChangeset
for help on using the changeset viewer.