Changeset b30846e in mainline


Ignore:
Timestamp:
2016-09-17T16:00:57Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d701672
Parents:
5a97302
Message:

Do not allow circular paging dependencies of two or more tasks

The mechanism of achieving this is rather simple in that it only allows
pagee-pager relationship between a numerically higher pagee task ID and
a numerically lower pager task ID.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ops/pagein.c

    r5a97302 rb30846e  
    4444#include <arch.h>
    4545
     46static int pagein_request_process(call_t *call, answerbox_t *box)
     47{
     48        /*
     49         * Allow only requests from numerically higher task IDs to
     50         * numerically lower task IDs to prevent deadlock in
     51         * pagein_answer_preprocess() that could happen if two tasks
     52         * wanted to be each other's pager.
     53         */
     54        if (call->sender->taskid <= TASK->taskid)
     55                return ENOTSUP;
     56        else
     57                return EOK;
     58}
     59
    4660static int pagein_answer_preprocess(call_t *answer, ipc_data_t *olddata)
    4761{
     
    8599        .request_preprocess = null_request_preprocess,
    86100        .request_forget = null_request_forget,
    87         .request_process = null_request_process,
     101        .request_process = pagein_request_process,
    88102        .answer_cleanup = null_answer_cleanup,
    89103        .answer_preprocess = pagein_answer_preprocess,
Note: See TracChangeset for help on using the changeset viewer.