From owner-freebsd-security@FreeBSD.ORG Tue Sep 3 08:30:57 2013 Return-Path: Delivered-To: freebsd-security@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 343FDCEB for ; Tue, 3 Sep 2013 08:30:57 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id E572023B0 for ; Tue, 3 Sep 2013 08:30:56 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1VGm2n-000F4F-79; Tue, 03 Sep 2013 12:33:01 +0400 Date: Tue, 3 Sep 2013 12:33:01 +0400 From: Slawa Olhovchenkov To: Dag-Erling Sm??rgrav Subject: Re: OpenSSH, PAM and kerberos Message-ID: <20130903083301.GF3796@zxy.spb.ru> References: <20130829004844.GA70584@zxy.spb.ru> <86d2ovy64p.fsf@nine.des.no> <20130830100926.GU3796@zxy.spb.ru> <20130830103009.GV3796@zxy.spb.ru> <86sixrwdcv.fsf@nine.des.no> <20130830131455.GW3796@zxy.spb.ru> <8661uj9lc6.fsf@nine.des.no> <20130902181754.GD3796@zxy.spb.ru> <867geywdfc.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <867geywdfc.fsf@nine.des.no> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: freebsd-security@FreeBSD.org X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Security issues \[members-only posting\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2013 08:30:57 -0000 On Tue, Sep 03, 2013 at 09:51:35AM +0200, Dag-Erling Sm??rgrav wrote: > Slawa Olhovchenkov writes: > > If in this scenario on step 4 insted fork do pthread_create we don't > > lost stored credentials and (I think) have full-synchronized thread > > (new thred only work by request from parent and only for short time). > > It's not quite that simple. When a service module calls a conversation > function, the event loop resumes until it receives an answer from the > client. This is why PAM needs to run in a separate thread or process. > OpenSSH was not designed to be multi-threaded, and we can't be sure > there won't be conflicts. We can be sure if separate thread don't access same data as other sshd, or while other sshd wait answer from separate thread. I don't see parallel execution in separate thread. > Another problem is that libpam loads shared objects (the modules) when > it runs, which may result in conflicts as well - espcially with > pam_ssh(8). Can you explain this? How conflicts and what scenario use pam_ssh in sshd? > The proper solution would be an identification and authentication daemon > with a well-designed RPC interface and mechanisms for transferring > environment variables, descriptors and credentials from the daemon to > the application (in this case, sshd). I think this is impossible, because credentials for pam_krb5 is simple pointer to internal blob's with unknown size, structure and links with other elements.