Date: Sat, 30 Jan 2016 15:03:29 -0700 From: Warner Losh <imp@bsdimp.com> To: Ian Lepore <ian@freebsd.org> Cc: mokhi <mokhi64@gmail.com>, FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: thread-unsafety problems as spl*() ones are NOP Message-ID: <CANCZdfrUjy=C0yjcW3QYbCHzYzAmrmC16GY2kpjKDoCBiCj_7Q@mail.gmail.com> In-Reply-To: <1454188175.32550.3.camel@freebsd.org> References: <CAByVWPWuqdtZ-5p2%2BvGf4v%2BPjjCBkiTQSsZQ06vk-f=bx_TQrQ@mail.gmail.com> <CAByVWPWQJ1wP95S59SiWWBa0k9j2%2Bu1az-D04_V1voo99CxqCw@mail.gmail.com> <1454188175.32550.3.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 30, 2016 at 2:09 PM, Ian Lepore <ian@freebsd.org> wrote: > On Sat, 2016-01-30 at 18:56 +0330, mokhi wrote: > > Hi. > > in kbd.c there are many places spltty()/splx() used assuming it > > locks/unlocks. > > though there is bug filed for this, and ive asked in #bsddev, Ive > > preferred to ask and ensure it from here again. > > As these functions are obsoleted now, this assumption is incorrect > > and > > some places we have thread-unsafely which leads to security problems > > (and/or for example double-free, etc) > > > > can i use mutex/spin/lock/unlock under where assumed a lock/unlock by > > using spltty()/splx() to patch it? > > > > Thanks, Mokhi. > > If you start working on locking in keyboard drivers you might discover > there are dragons there. For example... > > https://lists.freebsd.org/pipermail/svn-src-head/2014-March/056833.html In theory, they are all Giant locked. In reality, however, there are many dragons, and the dragons are difficult to slay... Though things have been chipped away enough that it might not be so bad now... I tried early in the locking game and found too many dependencies on Giant in the code that was called from the keyboard drivers to be able to make much progress. But that was in the FreeBSD 6 time frame, and Giant is almost gone from the rest of the system, so another run might not be so bad. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrUjy=C0yjcW3QYbCHzYzAmrmC16GY2kpjKDoCBiCj_7Q>