Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kauth and sched_{get,set}param



Elad Efrat <elad%NetBSD.org@localhost> wrote:
> Mindaugas R. wrote:
> 
> > Memory allocation/freeing and other operations which may block should
> > not be performed with the lock held.
> 
> Right. I reorganized the code to take care of all the places where it
> would allocate/free memory with p_smutex held -- please take a look to
> see if I forgot something.

You are allocating the memory with LWP-lock held:
> +     sp = kmem_zalloc(sizeof(struct sched_param), KM_SLEEP);
> +
>       sp->sched_priority = t->l_priority;
>       sp->sched_class = t->l_class;
>       lwp_unlock(t);

> so I don't see how we can call kauth with p without having either
> proclist_list or p_smutex held.

This is not a problem (while kauth call cannot block).

Anyway, I am preparing the patch for sys_sched.c and can include kauth
fixes if you want.

-- 
Best regards,
Mindaugas
www.NetBSD.org




Home | Main Index | Thread Index | Old Index