Panic during samba mount

Tero Jaasko tero.jaasko.no.spam.please at mail.suomi.net
Sun Jul 18 03:27:56 PDT 2010


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




More information about the Bugs mailing list