[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2322852.ElGaqSPkdT@watership>
Date: Wed, 15 May 2024 18:32:26 -0500
From: Elizabeth Figura <zfigura@...eweavers.com>
To: Peter Zijlstra <peterz@...radead.org>, wine-devel@...ehq.org
Cc: Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jonathan Corbet <corbet@....net>, Shuah Khan <shuah@...nel.org>,
linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
wine-devel@...ehq.org,
André Almeida <andrealmeid@...lia.com>,
Wolfram Sang <wsa@...nel.org>, Andy Lutomirski <luto@...nel.org>,
linux-doc@...r.kernel.org, linux-kselftest@...r.kernel.org,
Randy Dunlap <rdunlap@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Will Deacon <will@...nel.org>, Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>, Elizabeth Figura <zfigura@...eweavers.com>
Subject: Re: [PATCH v4 00/30] NT synchronization primitive driver
On Wednesday, April 17, 2024 3:02:13 PM CDT Elizabeth Figura wrote:
> > > Except for the "unowned" semantics of zero, the actual value of the
> > > owner identifier is not interpreted by the ntsync driver at all. The
> > > intended use is to store a thread identifier; however, the ntsync
> > > driver does not actually validate that a calling thread provides
> > > consistent or unique identifiers.
> >
> > Why not verify it? Seems simple enough to put in a TID check, esp. if NT
> > mandates the same.
>
> I mostly figured it'd be simplest to leave the driver completely
> agnostic, but I don't think there's any reason we can't use the real
> TID for most calls.
While trying to implement this I did realize a reason: if a Linux thread dies
and a new Wine thread is created which happens to have the same Linux TID
*before* Wine notices the thread death, that thread's TID will be conflated
with the thread that died. I don't think we can guarantee that we notice
thread death before we notice a request to create a new Wine thread.
Using Wine-managed TIDs avoids this by virtue of ensuring that a Wine TID is
not reused until the associated Wine thread has been cleaned up.
Powered by blists - more mailing lists