Subject: Re: CVS commit: src/sys/kern
To: None <elad@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 10/02/2006 19:02:07
> Module Name: src
> Committed By: elad
> Date: Mon Oct 2 09:22:34 UTC 2006
>
> Modified Files:
> src/sys/kern: uipc_socket.c
>
> Log Message:
> Move the kauth_cred_free() call above the "is connected" check to not
> leak credentials.
>
> Pointed out by yamt@, thanks!
i don't think sodisconnect is an appropriate place to free a credential.
you still leak a credential if the socket is not connected at all.
besides, what will happen if the socket is reconnected?
sofree seems more appropriate, but i vaguely remember that it can be called
from interrupt context. (please confirm.)
YAMAMOTO Takashi