DragonFly BSD
DragonFly bugs List (threaded) for 2010-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Panic during samba mount


From: Tero Jaasko <tero.jaasko.no.spam.please@xxxxxxxxxxxxxx>
Date: Sun, 18 Jul 2010 13:27:56 +0300

On 10.7.2010 12:06, Nicolas Thery wrote:

td is a samba kernel thread created in smb_iod_create() by calling
kthread_create_compat() which according to its comment is used only for samba.

kthread_create_compat() forks process 0 so the resulting kernel thread is a bit
different from other kernel threads: td->td_ucred == NULL but td->td_proc !=
NULL (it points to the forked process).  This explains why the td_proc == NULL
check at the beginning of prison_replace_wildcard(), which is presumably there
for detecting kernel threads, fails.

prison_remote_ip() already checks if td_ucred != NULL before dereferencing it
so your patch looks good and a committed it.  In the longer term, changing
samba to create a lwkt is probably the way to go.

Thank you for the analysis and fix.


BR,
-Tero



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