Re: kern/127446: [patch] fix race in sys/dev/kbdmux/kbdmux.c

From: Maksim Yevmenkin <maksim.yevmenkin_at_gmail.com>
Date: Fri, 19 Sep 2008 09:20:41 -0700
[moving to -current]

On 9/18/08, Eygene Ryabinkin <rea-fbsd_at_codelabs.ru> wrote:
> Me again.
>
>
>  Thu, Sep 18, 2008 at 11:10:17AM +0400, Eygene Ryabinkin wrote:
>  > OK, I had tried substituting KBDMUX_LOCK/UNLOCK with Giant operations --
>  > it works as expected.
>
>
> Tried my initial patch on some 7.0-PRERELEASE -- it locks keyboard when
>  geli asks for the password.  Had not much time to dig it out, will try
>  to do it as soon as I can.  Substituting KBDMUX_LOCK/UNLOCK with Giant
>  locking helps even on this FreeBSD version.
>
>  More testing needed, may be there are some other issues that aren't
>  revealing themselves...

did you have a chance to do some testing? i tried substituting
KBDMUX_LOCK/UNLOCK with Giant locking here locally and played with a
couple of keyboards under X and console. no apparent issues or witness
complains.

would it be ok for me to commit this?

--- kbdmux.c.orig       2008-07-29 14:21:20.000000000 -0700
+++ kbdmux.c    2008-09-19 09:02:54.000000000 -0700
_at__at_ -104,9 +104,11 _at__at_

 #define KBDMUX_LOCK_DESTROY(s)

-#define KBDMUX_LOCK(s)
+#define KBDMUX_LOCK(s) \
+       mtx_lock(&Giant)

-#define KBDMUX_UNLOCK(s)
+#define KBDMUX_UNLOCK(s) \
+       mtx_unlock(&Giant)

 #define KBDMUX_LOCK_ASSERT(s, w)

thanks,
max
Received on Fri Sep 19 2008 - 14:20:43 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:35 UTC