Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 931afbc in mainline for kernel/generic/src/ipc/sysipc.c


Ignore:
Timestamp:
2018-06-09T08:41:53Z (3 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
ec39720
Parents:
75701004
Message:

Don't republish call capability on forward failure

When forwarding of a call fails for some reason, the kernel
automatically answers the forwarded call with EFORWARD. It must not
republish the capability because only unanswered calls are associated
with a capability (so that they can be forwarded or answered).
Republishing the capability makes it possible for userspace to attempt
to answer such a call again, which results in kernel panic due to a
failed assertion. As an interesting fact, uspace functions
async_data_read_forward_fast and async_data_write_forward_fast do this.

Also, the motivation behind republishing the capability as explained
by the removed comment turns out to be invalid because such a call
ends up among the original caller's answers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/sysipc.c

    r75701004 r931afbc  
    552552                ipc_answer(&TASK->answerbox, call);
    553553
    554         /* Republish the capability so that the call does not get lost. */
    555         cap_publish(TASK, chandle, ckobj);
     554        cap_free(TASK, chandle);
     555        kobject_put(ckobj);
    556556
    557557        if (pkobj)
     
    642642
    643643        call_t *call = kobj->call;
     644        assert(!(call->flags & IPC_CALL_ANSWERED));
    644645
    645646        ipc_data_t saved_data;
     
    688689
    689690        call_t *call = kobj->call;
     691        assert(!(call->flags & IPC_CALL_ANSWERED));
    690692
    691693        ipc_data_t saved_data;
Note: See TracChangeset for help on using the changeset viewer.