Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 2008 09:20:41 -0700
From:      "Maksim Yevmenkin" <maksim.yevmenkin@gmail.com>
To:        "Eygene Ryabinkin" <rea-fbsd@codelabs.ru>
Cc:        rik@freebsd.org, current@freebsd.org, bug-followup@freebsd.org
Subject:   Re: kern/127446: [patch] fix race in sys/dev/kbdmux/kbdmux.c
Message-ID:  <bb4a86c70809190920l29f40e3cja19f6795e19b02b@mail.gmail.com>
In-Reply-To: <OukumQcOIGlPdbI1QmdweY8cFsk@IW4pzQfcswHj%2B/3imThIGjvxQdw>
References:  <20080917161633.9E2F717101@shadow.codelabs.ru> <bb4a86c70809170956x36234893he8894a49127b6b6e@mail.gmail.com> <gaH7cu1zt0Bw5e8Q2XfgrlKSRyY@iXA9ZWPrtc2I2BMzBXoToMd7YdQ> <bb4a86c70809171052t5e961675n139b2848e6addd0@mail.gmail.com> <OBTLESaczqaewZBU9qdf0FWZRHE@7/OI9n2WwGs0JPogavdPqCpU9P8> <OukumQcOIGlPdbI1QmdweY8cFsk@IW4pzQfcswHj%2B/3imThIGjvxQdw>

next in thread | previous in thread | raw e-mail | index | archive | help
[moving to -current]

On 9/18/08, Eygene Ryabinkin <rea-fbsd@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
@@ -104,9 +104,11 @@

 #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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bb4a86c70809190920l29f40e3cja19f6795e19b02b>