From owner-freebsd-bugs@FreeBSD.ORG Wed Nov 13 21:00:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3678EF1F for ; Wed, 13 Nov 2013 21:00:02 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 261B12EE1 for ; Wed, 13 Nov 2013 21:00:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id rADL01Ci075532 for ; Wed, 13 Nov 2013 21:00:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id rADL01mf075530; Wed, 13 Nov 2013 21:00:01 GMT (envelope-from gnats) Date: Wed, 13 Nov 2013 21:00:01 GMT Message-Id: <201311132100.rADL01mf075530@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Ed Schouten Subject: Re: misc/183495: utx.active not being updated correctly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list Reply-To: Ed Schouten List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Nov 2013 21:00:02 -0000 The following reply was made to PR misc/183495; it has been noted by GNATS. From: Ed Schouten To: bug-followup@FreeBSD.org, rich@enterprisesystems.net Cc: freebsd-hackers@freebsd.org Subject: Re: misc/183495: utx.active not being updated correctly Date: Wed, 13 Nov 2013 21:58:32 +0100 Hi there, [ +freebsd-hackers, to see whether this change would go in the right direction ] It seems that the regression described in misc/183495 is unrelated to utmpx alone. Unlike utmp, utmpx allows multiple entries per TTY. This causes the issue to become actually visible. telnetd uses login(1) to provide a login prompt, interactive shell, etc. Looking at the source code of login(1), it seems that it never attempts to call pam_cleanup() whenever the process terminates with SIGHUP, nor does it protect itself against SIGTERM properly. The following patch should fix this issue partially: http://80386.nl/pub/login-signal-fix.txt Still, one issue that remains is that the parent process can still be killed using SIGKILL, thereby allowing you to circumvent pam_cleanup(). What would be the right approach to fix this? Changing the effective UID would solve this, but I don't feel really comfortable to modify these kind of pieces of software. It's easy to introduce security bugs. Thoughts? -- Ed Schouten