aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-06-22 23:55:38 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-23 16:57:56 -0400
commit961ccddd59d627b89bd3dc284b6517833bbdf25d (patch)
tree4d755085845b8beeaa0bbc3d3ee66e1ccc4156a8 /include/linux/sched.h
parent481c5346d0981940ee63037eb53e4e37b0735c10 (diff)
sched: add new API sched_setscheduler_nocheck: add a flag to control access checks
Hidehiro Kawai noticed that sched_setscheduler() can fail in stop_machine: it calls sched_setscheduler() from insmod, which can have CAP_SYS_MODULE without CAP_SYS_NICE. Two cases could have failed, so are changed to sched_setscheduler_nocheck: kernel/softirq.c:cpu_callback() - CPU hotplug callback kernel/stop_machine.c:__stop_machine_run() - Called from various places, including modprobe() Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: linux-mm@kvack.org Cc: sugita <yumiko.sugita.yf@hitachi.com> Cc: Satoshi OSHIMA <satoshi.oshima.fk@hitachi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c5d3f847ca8d..fe3b9b5d7390 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1655,6 +1655,8 @@ extern int can_nice(const struct task_struct *p, const int nice);
1655extern int task_curr(const struct task_struct *p); 1655extern int task_curr(const struct task_struct *p);
1656extern int idle_cpu(int cpu); 1656extern int idle_cpu(int cpu);
1657extern int sched_setscheduler(struct task_struct *, int, struct sched_param *); 1657extern int sched_setscheduler(struct task_struct *, int, struct sched_param *);
1658extern int sched_setscheduler_nocheck(struct task_struct *, int,
1659 struct sched_param *);
1658extern struct task_struct *idle_task(int cpu); 1660extern struct task_struct *idle_task(int cpu);
1659extern struct task_struct *curr_task(int cpu); 1661extern struct task_struct *curr_task(int cpu);
1660extern void set_curr_task(int cpu, struct task_struct *p); 1662extern void set_curr_task(int cpu, struct task_struct *p);