Add endpoint checks in scheduling kernel calls
This commit is contained in:
parent
49165ef796
commit
78186ee5f5
|
@ -9,12 +9,16 @@
|
|||
PUBLIC int do_schedctl(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
struct proc *p;
|
||||
int proc_nr;
|
||||
|
||||
/* Only system processes can change process schedulers */
|
||||
if (! (priv(caller)->s_flags & SYS_PROC))
|
||||
return(EPERM);
|
||||
|
||||
p = proc_addr(_ENDPOINT_P(m_ptr->SCHEDULING_ENDPOINT));
|
||||
if (!isokendpt(m_ptr->SCHEDULING_ENDPOINT, &proc_nr))
|
||||
return EINVAL;
|
||||
|
||||
p = proc_addr(proc_nr);
|
||||
p->p_scheduler = caller;
|
||||
|
||||
return(OK);
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
PUBLIC int do_schedule(struct proc * caller, message * m_ptr)
|
||||
{
|
||||
struct proc *p;
|
||||
int proc_nr;
|
||||
|
||||
if (!isokendpt(m_ptr->SCHEDULING_ENDPOINT, &proc_nr))
|
||||
return EINVAL;
|
||||
|
||||
p = proc_addr(_ENDPOINT_P(m_ptr->SCHEDULING_ENDPOINT));
|
||||
|
||||
|
|
Loading…
Reference in a new issue