From nobody@FreeBSD.org  Tue May 15 23:05:25 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 463C316A402
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 May 2007 23:05:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 385FD13C459
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 May 2007 23:05:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l4FN5POa014301
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 May 2007 23:05:25 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l4FN0Nl6014039;
	Tue, 15 May 2007 23:00:23 GMT
	(envelope-from nobody)
Message-Id: <200705152300.l4FN0Nl6014039@www.freebsd.org>
Date: Tue, 15 May 2007 23:00:23 GMT
From: Chris Cowart<ccowart@rescomp.berkeley.edu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: segfault in pam_lastlog on sshd exit when no pty allocated
X-Send-Pr-Version: www-3.0

>Number:         112695
>Category:       i386
>Synopsis:       segfault in pam_lastlog on sshd exit when no pty allocated
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 15 23:10:06 GMT 2007
>Closed-Date:    Tue May 22 16:05:27 GMT 2007
>Last-Modified:  Tue May 22 16:05:27 GMT 2007
>Originator:     Chris Cowart
>Release:        6_1_RELEASE
>Organization:
RSSP-IT, UC Berkeley
>Environment:
FreeBSD mug.rescomp.berkeley.edu 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May 21 23:35:28 PDT 2006     root@mug.rescomp.berkeley.edu:/usr/obj/usr/src/sys/NEWMUG0  i386
>Description:
When I ssh into FreeBSD hosts without allocating a tty, sshd segfaults
after the process terminates. This problem occurs on both 6_1_REL and
6_2_REL installations at all sorts of patch levels.

Examples:

Client: `ssh -t server ls`
Server Logs: 
| May  9 15:33:44 server sshd[1503]: Accepted publickey for ccowart from 
|     client port 43604 ssh2
| May  9 15:33:45 server sshd[1505]: pam_sm_close_session(): no utmp 
|     record for ttyp5

Client: `ssh server ls`
Server Logs:
| May  9 15:33:50 server sshd[1509]: Accepted publickey for ccowart from
|   client port 42119 ssh2
| May  9 15:33:51 server pid 1511 (sshd), uid 1225: exited on signal 11

In either example, the client thinks the command has completed
successfully, shows proper output, and propogates the return value from
the remote command. The main problem is I don't like seeing a bunch of
segfaults being logged in the daily run output.


>How-To-Repeat:
Uncommenting one rule at a time in my pam stack, I discovered the
culprit: pam_lastlog

The session section of my system pam configuration looks like this:

| # session
| session     required    pam_lastlog.so      no_fail
| session     optional    /usr/local/lib/pam_ldap.so no_warn

When I comment out the pam_lastlog, the segfaults vanish.

When I change the entire pam stack to pam_permit, with the exception of pam_lastlog, the segfaults still occur.
>Fix:
No known solution.
>Release-Note:
>Audit-Trail:

From: Christopher Cowart <ccowart@rescomp.berkeley.edu>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/112695: segfault in pam_lastlog on sshd exit when no pty allocated
Date: Wed, 16 May 2007 15:30:05 -0700

 --HlL+5n6rz5pIUxbD
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 Sorry. This is a duplicate of 112694.
 
 --=20
 Chris Cowart
 Lead Systems Administrator
 Network Infrastructure, RSSP-IT
 UC Berkeley
 
 --HlL+5n6rz5pIUxbD
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: Digital signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.3 (GNU/Linux)
 
 iD8DBQFGS4XtV3SOqjnqPh0RAlGXAKClLxJDTDNj80ZwLfrYwrAyKJnK3gCgix00
 r4cFMGwp9wJze689BV+o7ik=
 =0bM5
 -----END PGP SIGNATURE-----
 
 --HlL+5n6rz5pIUxbD--

From: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/112695: segfault in pam_lastlog on sshd exit when no pty
	allocated
Date: Tue, 22 May 2007 16:40:53 +0100

 This PR is a duplicate of i386/112694 and should be closed.
State-Changed-From-To: open->closed 
State-Changed-By: remko 
State-Changed-When: Tue May 22 16:05:24 UTC 2007 
State-Changed-Why:  
Gavin: This PR is a duplicate of i386/112694 and should be closed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=112695 
>Unformatted:
