Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28958
b: refs/heads/master
c: 3560154
h: refs/heads/master
v: v3
  • Loading branch information
David Quigley authored and Linus Torvalds committed Jun 23, 2006
1 parent 819cd35 commit 324c5d7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 22fb52dd736a62e24c44c50739007496265dc38c
refs/heads/master: 35601547baf92d984b6e59cf3583649da04baea5
15 changes: 15 additions & 0 deletions trunk/include/linux/security.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,10 @@ struct swap_info_struct;
* @p.
* @p contains the task_struct for process.
* Return 0 if permission is granted.
* @task_movememory
* Check permission before moving memory owned by process @p.
* @p contains the task_struct for process.
* Return 0 if permission is granted.
* @task_kill:
* Check permission before sending signal @sig to @p. @info can be NULL,
* the constant 1, or a pointer to a siginfo structure. If @info is 1 or
Expand Down Expand Up @@ -1220,6 +1224,7 @@ struct security_operations {
int (*task_setscheduler) (struct task_struct * p, int policy,
struct sched_param * lp);
int (*task_getscheduler) (struct task_struct * p);
int (*task_movememory) (struct task_struct * p);
int (*task_kill) (struct task_struct * p,
struct siginfo * info, int sig);
int (*task_wait) (struct task_struct * p);
Expand Down Expand Up @@ -1865,6 +1870,11 @@ static inline int security_task_getscheduler (struct task_struct *p)
return security_ops->task_getscheduler (p);
}

static inline int security_task_movememory (struct task_struct *p)
{
return security_ops->task_movememory (p);
}

static inline int security_task_kill (struct task_struct *p,
struct siginfo *info, int sig)
{
Expand Down Expand Up @@ -2512,6 +2522,11 @@ static inline int security_task_getscheduler (struct task_struct *p)
return 0;
}

static inline int security_task_movememory (struct task_struct *p)
{
return 0;
}

static inline int security_task_kill (struct task_struct *p,
struct siginfo *info, int sig)
{
Expand Down
6 changes: 6 additions & 0 deletions trunk/security/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,11 @@ static int dummy_task_getscheduler (struct task_struct *p)
return 0;
}

static int dummy_task_movememory (struct task_struct *p)
{
return 0;
}

static int dummy_task_wait (struct task_struct *p)
{
return 0;
Expand Down Expand Up @@ -981,6 +986,7 @@ void security_fixup_ops (struct security_operations *ops)
set_to_dummy_if_null(ops, task_setrlimit);
set_to_dummy_if_null(ops, task_setscheduler);
set_to_dummy_if_null(ops, task_getscheduler);
set_to_dummy_if_null(ops, task_movememory);
set_to_dummy_if_null(ops, task_wait);
set_to_dummy_if_null(ops, task_kill);
set_to_dummy_if_null(ops, task_prctl);
Expand Down
6 changes: 6 additions & 0 deletions trunk/security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -2679,6 +2679,11 @@ static int selinux_task_getscheduler(struct task_struct *p)
return task_has_perm(current, p, PROCESS__GETSCHED);
}

static int selinux_task_movememory(struct task_struct *p)
{
return task_has_perm(current, p, PROCESS__SETSCHED);
}

static int selinux_task_kill(struct task_struct *p, struct siginfo *info, int sig)
{
u32 perm;
Expand Down Expand Up @@ -4392,6 +4397,7 @@ static struct security_operations selinux_ops = {
.task_setrlimit = selinux_task_setrlimit,
.task_setscheduler = selinux_task_setscheduler,
.task_getscheduler = selinux_task_getscheduler,
.task_movememory = selinux_task_movememory,
.task_kill = selinux_task_kill,
.task_wait = selinux_task_wait,
.task_prctl = selinux_task_prctl,
Expand Down

0 comments on commit 324c5d7

Please sign in to comment.