Changeset 8498915 in mainline for uspace


Ignore:
Timestamp:
2007-11-22T09:09:04Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0cc4313
Parents:
b74959bd
Message:

Be more deterministic when a user accidently uses fast version of IPC
call/answer instead of the full one and passes fewer arguments than required by
the recipient of the call/response.

and the recipient interprets arguments that
were actually not passed by the sender.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/ipc.c

    rb74959bd r8498915  
    321321                IPC_SET_ARG3(call->u.msg.data, arg3);
    322322                IPC_SET_ARG4(call->u.msg.data, arg4);
     323                /*
     324                 * To achieve deterministic behavior, we always zero out the
     325                 * arguments that are beyond the limits of the fast version.
     326                 */
     327                IPC_SET_ARG5(call->u.msg.data, 0);
    323328        }
    324329        ipc_finish_async(callid, phoneid, call, can_preempt);
     
    436441        while (!list_empty(&queued_calls)) {
    437442                call = list_get_instance(queued_calls.next, async_call_t, list);
    438                 callid = _ipc_call_async(call->u.msg.phoneid, &call->u.msg.data);
     443                callid = _ipc_call_async(call->u.msg.phoneid,
     444                    &call->u.msg.data);
    439445                if (callid == IPC_CALLRET_TEMPORARY) {
    440446                        break;
     
    646652 * For non-system methods, the old method and arg1 are rewritten by the new
    647653 * values. For system methods, the new method and arg1 are written to the old
    648  * arg1 and arg2, respectivelly.
    649  */
    650 int ipc_forward_fast(ipc_callid_t callid, int phoneid, int method, ipcarg_t arg1)
     654 * arg1 and arg2, respectivelly. Calls with immutable methods are forwarded
     655 * verbatim.
     656 */
     657int ipc_forward_fast(ipc_callid_t callid, int phoneid, int method,
     658    ipcarg_t arg1)
    651659{
    652660        return __SYSCALL4(SYS_IPC_FORWARD_FAST, callid, phoneid, method, arg1);
Note: See TracChangeset for help on using the changeset viewer.