Changeset d24e987 in mainline for kernel/generic/include/cap/cap.h


Ignore:
Timestamp:
2018-10-16T18:03:43Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2d93763a, e344422
Parents:
c0cef6f9
git-author:
Jakub Jermar <jakub@…> (2018-10-16 17:55:57)
git-committer:
Jakub Jermar <jakub@…> (2018-10-16 18:03:43)
Message:

Make access via capabilities revokable

This commit makes it possible to revoke access to a kernel object from
all capabilities across all tasks. In order to support this, each kernel
object is equipped with a list of capabilities that point to it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/cap/cap.h

    rc0cef6f9 rd24e987  
    6969
    7070/*
    71  * Everything in kobject_t except for the atomic reference count is imutable.
     71 * Everything in kobject_t except for the atomic reference count, the capability
     72 * list and its lock is imutable.
    7273 */
    7374typedef struct kobject {
    7475        kobject_type_t type;
    7576        atomic_t refcnt;
     77
     78        /** Mutex protecting caps_list */
     79        mutex_t caps_list_lock;
     80        /** List of published capabilities associated with the kobject */
     81        list_t caps_list;
    7682
    7783        kobject_ops_t *ops;
     
    9399        struct task *task;
    94100        cap_handle_t handle;
     101
     102        /** Link to the kobject's list of capabilities. */
     103        link_t kobj_link;
    95104
    96105        /* Link to the task's capabilities of the same kobject type. */
     
    122131extern void cap_publish(struct task *, cap_handle_t, kobject_t *);
    123132extern kobject_t *cap_unpublish(struct task *, cap_handle_t, kobject_type_t);
     133extern void cap_revoke(kobject_t *);
    124134extern void cap_free(struct task *, cap_handle_t);
    125135
Note: See TracChangeset for help on using the changeset viewer.