From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 13 20:58:33 2013 Return-Path: Delivered-To: freebsd-hackers@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 A0B81E1E; Wed, 13 Nov 2013 20:58:33 +0000 (UTC) Received: from mail-ve0-x233.google.com (mail-ve0-x233.google.com [IPv6:2607:f8b0:400c:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 530112EC1; Wed, 13 Nov 2013 20:58:33 +0000 (UTC) Received: by mail-ve0-f179.google.com with SMTP id oz11so790054veb.24 for ; Wed, 13 Nov 2013 12:58:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:cc:content-type; bh=deZ16qQlW9G44hotWbDShH5K/JB+iFdxbVUGmnNnfBI=; b=t5rl5YKYg7Tgfh9Gut4Y/83A/y78QPenvuxcR8zc1eht6SIa4BkysS99Rk0nvMb2ij 4xZ5ynL4nPDCNc8pfAdNVSX+vRpkitLPKt++02RI2USyD+Ij0dPkpWMl1Yd5s7/rGRyu 7GY+rmBK8dbWNpcK4D8MfUIv4Y1SIUmx0NFTAo1VO/TD0kFTsWWnh7AF1CvzaOAaqKD/ RLxmA8qoOP8cO4ro2GAzjzDKp+bdBF5ZxR7TIGXUQzv5Qig+xZG2JHej82EHOXIsk/dJ hR3kzpvJZ+j+DI8+LIqsalaPouhSpHpF/Z9Id38BE6VhC4sI/aSVY03BGS1xbEGVx13I A7Xw== MIME-Version: 1.0 X-Received: by 10.58.254.38 with SMTP id af6mr172260ved.85.1384376312230; Wed, 13 Nov 2013 12:58:32 -0800 (PST) Sender: edschouten@gmail.com Received: by 10.220.104.209 with HTTP; Wed, 13 Nov 2013 12:58:32 -0800 (PST) Date: Wed, 13 Nov 2013 21:58:32 +0100 X-Google-Sender-Auth: lg7pgfzFbjnWbezi5qi9dob0LI4 Message-ID: Subject: Re: misc/183495: utx.active not being updated correctly From: Ed Schouten To: bug-followup@FreeBSD.org, rich@enterprisesystems.net Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Nov 2013 20:58:33 -0000 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