From owner-svn-src-all@FreeBSD.ORG Thu May 21 16:24:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79C8210656A6; Thu, 21 May 2009 16:24:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id AAA3F8FC21; Thu, 21 May 2009 16:24:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1M7B4L-000IoG-SS; Thu, 21 May 2009 19:24:34 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n4LGOMg0031181 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 May 2009 19:24:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n4LGOMDa072436; Thu, 21 May 2009 19:24:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n4LGOM3O072435; Thu, 21 May 2009 19:24:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2009 19:24:22 +0300 From: Kostik Belousov To: Ed Schouten Message-ID: <20090521162422.GR1927@deviant.kiev.zoral.com.ua> References: <200905211619.n4LGJsDV071739@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gIhrS3Q23Nl70UJ5" Content-Disposition: inline In-Reply-To: <200905211619.n4LGJsDV071739@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.1 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1M7B4L-000IoG-SS 645625d929abf11c93696f1ce318131c X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r192544 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 16:24:37 -0000 --gIhrS3Q23Nl70UJ5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 21, 2009 at 04:19:54PM +0000, Ed Schouten wrote: > Author: ed > Date: Thu May 21 16:19:54 2009 > New Revision: 192544 > URL: http://svn.freebsd.org/changeset/base/192544 >=20 > Log: > Add a new sysctl: kern.tty_inq_flush_secure. > =20 > When enabled all TTY input queue buffers are zeroed when flushing or > closing the TTY. Because TTY input queues are also used to store filled > in passwords, this may be an interesting switch to enable for security > minded people. Why is this enabled by sysctl ? Such feature shall be unconditional if it has any value. >=20 > Modified: > head/sys/kern/tty_inq.c >=20 > Modified: head/sys/kern/tty_inq.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/tty_inq.c Thu May 21 16:18:45 2009 (r192543) > +++ head/sys/kern/tty_inq.c Thu May 21 16:19:54 2009 (r192544) > @@ -68,6 +68,9 @@ SYSCTL_ULONG(_kern, OID_AUTO, tty_inq_nf > static unsigned long ttyinq_nslow =3D 0; > SYSCTL_ULONG(_kern, OID_AUTO, tty_inq_nslow, CTLFLAG_RD, > &ttyinq_nslow, 0, "Buffered reads to userspace on input"); > +static int ttyinq_flush_secure =3D 0; > +SYSCTL_INT(_kern, OID_AUTO, tty_inq_flush_secure, CTLFLAG_RW, > + &ttyinq_flush_secure, 0, "Zero buffers while flushing"); > =20 > #define TTYINQ_QUOTESIZE (TTYINQ_DATASIZE / BMSIZE) > #define BMSIZE 32 > @@ -376,28 +379,19 @@ ttyinq_findchar(struct ttyinq *ti, const > void > ttyinq_flush(struct ttyinq *ti) > { > + struct ttyinq_block *tib =3D ti->ti_lastblock; > =20 > ti->ti_begin =3D 0; > ti->ti_linestart =3D 0; > ti->ti_reprint =3D 0; > ti->ti_end =3D 0; > -} > - > -#if 0 > -void > -ttyinq_flush_safe(struct ttyinq *ti) > -{ > - struct ttyinq_block *tib; > - > - ttyinq_flush(ti); > =20 > - /* Zero all data in the input queue to make it more safe */ > - TAILQ_FOREACH(tib, &ti->ti_list, tib_list) { > - bzero(&tib->tib_quotes, sizeof tib->tib_quotes); > - bzero(&tib->tib_data, sizeof tib->tib_data); > + /* Zero all data in the input queue to get rid of passwords. */ > + if (ttyinq_flush_secure) { > + for (tib =3D ti->ti_firstblock; tib !=3D NULL; tib =3D tib->tib_next) > + bzero(&tib->tib_data, sizeof tib->tib_data); > } > } > -#endif > =20 > int > ttyinq_peekchar(struct ttyinq *ti, char *c, int *quote) --gIhrS3Q23Nl70UJ5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkoVgDYACgkQC3+MBN1Mb4glpwCbBx7y1pO7YQ28JZnL7crcrT1h c18AoLceQ5PuiCRQ3LKV0yx7OhWxltWo =wKK+ -----END PGP SIGNATURE----- --gIhrS3Q23Nl70UJ5--