From owner-freebsd-mobile@FreeBSD.ORG Sun Mar 2 05:02:41 2008 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 826DF106566B for ; Sun, 2 Mar 2008 05:02:41 +0000 (UTC) (envelope-from tamaru@myn.rcast.u-tokyo.ac.jp) Received: from mail6.ecc.u-tokyo.ac.jp (mail6.ecc.u-tokyo.ac.jp [133.11.205.126]) by mx1.freebsd.org (Postfix) with ESMTP id 3A6DA8FC1A for ; Sun, 2 Mar 2008 05:02:41 +0000 (UTC) (envelope-from tamaru@myn.rcast.u-tokyo.ac.jp) Received: from mhs001.ecc.u-tokyo.ac.jp (unknown [133.11.70.161]) by mail6.ecc.u-tokyo.ac.jp (Postfix) with ESMTP id 3F52E1B5D22 for ; Sun, 2 Mar 2008 13:45:52 +0900 (JST) Received: from amulet.amuletic.net (124.155.55.252 [124.155.55.252]) by mhs001.ecc.u-tokyo.ac.jp (SpamBlock.pstn.b 3.4.102) with ESMTP id for ; Sun, 2 Mar 2008 13:45:47 +0900 Date: Sun, 02 Mar 2008 13:45:47 +0900 Message-ID: From: Hiroharu Tamaru To: freebsd-mobile@freebsd.org User-Agent: User-Agent: Wanderlust/2.14.0 (Africa) Emacs/21.3 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-IP: 124.155.55.252 X-FROM-DOMAIN: myn.rcast.u-tokyo.ac.jp X-FROM-EMAIL: tamaru@myn.rcast.u-tokyo.ac.jp Cc: Pawel Jakub Dawidek Subject: keystrokes unreliable for geli passphrase input at boot on ThinkpadX60 X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2008 05:02:41 -0000 Hi, Pawel and mobile people, I've been running geom_eli root fs on my note book for some time. It happened that keyboard input for the geom_eli passphrase input is very unreliable when it is prompted from the kernel at boot time to capture the passphrase for the root filesystem: not every keystroke is recognized, and since there are no echo backs, it is very hard, if possible at all, to type it correctly. For such an emergency, kern.geom.eli.visible_passphrase=1 surely helps by echoing back the keys actually recognized, but it leaves the plaintext passphrase in the log file. I've been running a patched version of libkern/gets.c to echo back *'s instead of the actual input. It worked well for me on my old CASIO Casiopeia FIVA, and I just thought it was some BIOS or timing issue on an old note book. Now, it turns out that a newer Thinkpad X60 also suffers from this issue, and I wondered how other people are going along. If this is something more universal, I'd appreciate if you could commit this workaround patch and MFC. The patch also prevents to log the number of characters in your passphrase. Thanks. Hiroharu Tamaru --- sys/libkern/gets.c- Sun Mar 2 12:56:48 2008 +++ sys/libkern/gets.c Sun Mar 2 13:08:31 2008 @@ -43,27 +43,32 @@ for (;;) { c = cngetc() & 0177; switch (c) { case '\n': case '\r': - printf("%c", c); *lp = '\0'; + if (!visible) { + for (; lp < end; ++lp) + printf("*"); + } + printf("%c", c); return; case '\b': case '\177': if (lp > cp) { - if (visible) - printf("%c \b", c); + printf("%c \b", c); lp--; } continue; case '\0': continue; default: if (lp < end) { if (visible) printf("%c", c); + else + printf("*"); *lp++ = c; } } } }