Subject: Re: kauth and sched_{get,set}param
To: Elad Efrat <elad@NetBSD.org>
From: Mindaugas R. <rmind@NetBSD.org>
List: current-users
Date: 02/03/2008 23:54:57
Elad Efrat <elad@NetBSD.org> 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