svn commit: r190857 - head/sys/dev/kbdmux

Fabian Keil freebsd-listen at fabiankeil.de
Sun Apr 12 08:03:48 PDT 2009


Maksim Yevmenkin <emax at FreeBSD.org> wrote:

> Author: emax
> Date: Wed Apr  8 20:52:30 2009
> New Revision: 190857
> URL: http://svn.freebsd.org/changeset/base/190857
> 
> Log:
>   Undo SVN rev 183283
>   
>   Do not use Giant for kbdmux(4) locking. This is wrong and apparently
>   causing more problems than it solves. This will re-open the issue
>   where interrupt handlers may race with kbdmux(4) in polling mode.
>   Typical symptoms include (but not limited to) duplicated and/or
>   missing characters when low level console functions (such as gets)
>   are used while interrupts are enabled (for example geli password
>   prompt, mountroot prompt etc.)
>   
>   MFC after:	3 days
> 
> Modified:
>   head/sys/dev/kbdmux/kbdmux.c
> 
> Modified: head/sys/dev/kbdmux/kbdmux.c
> ==============================================================================
> --- head/sys/dev/kbdmux/kbdmux.c	Wed Apr  8 20:43:19 2009	(r190856)
> +++ head/sys/dev/kbdmux/kbdmux.c	Wed Apr  8 20:52:30 2009	(r190857)
> @@ -104,10 +104,10 @@ MALLOC_DEFINE(M_KBDMUX, KEYBOARD_NAME, "
>  
>  #define KBDMUX_LOCK_DESTROY(s)
>  
> -#define KBDMUX_LOCK(s) \
> -	mtx_lock(&Giant)
> -#define KBDMUX_UNLOCK(s) \
> -	mtx_unlock(&Giant)
> +#define KBDMUX_LOCK(s)
> +
> +#define KBDMUX_UNLOCK(s)
> +
>  #define KBDMUX_LOCK_ASSERT(s, w)
>  
>  #define KBDMUX_SLEEP(s, f, d, t) \

How about turning this into a compile-time or sysctl option
or at least mentioning the change in /usr/src/UPDATING?

With this commit, providing the geli key phrase on
boot is impossible on my AMD64 dual core system.

Not even enabling the "visible characters" option helps
because obviously backspace is broken too.

Before theses locks were introduces I worked around the problem
with this gets() hack (which forced me to reduce the key entropy):
http://www.fabiankeil.de/sourcecode/freebsd/gets-no-duplicates.diff
and now I will simply revert your commit locally, but I assume I'm
not the only geli user who prefers to be able to boot the system
without local patches.

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20090412/4e73f9db/signature.pgp


More information about the freebsd-current mailing list