Re: Prevent races w/ f_data

2018-06-21 Thread Martin Pieuchot
On 20/06/18(Wed) 17:16, Mark Kettenis wrote: > > Date: Wed, 20 Jun 2018 15:17:27 +0200 > > From: Martin Pieuchot > > Joel, the diff below changes the semantics of the DIOCMAP ioctl a bit. > See the bit about DIOCMAP below. I think this approach is better. > But maybe I'm missing someting... > >

Re: Prevent races w/ f_data

2018-06-20 Thread Mark Kettenis
> Date: Wed, 20 Jun 2018 15:17:27 +0200 > From: Martin Pieuchot Joel, the diff below changes the semantics of the DIOCMAP ioctl a bit. See the bit about DIOCMAP below. I think this approach is better. But maybe I'm missing someting... Martin, I like fnew(). I can use that in the prime/DRI3 stu

Re: Prevent races w/ f_data

2018-06-20 Thread Martin Pieuchot
On 19/06/18(Tue) 16:40, Mark Kettenis wrote: > > Date: Tue, 19 Jun 2018 15:45:48 +0200 > > From: Martin Pieuchot > > On 19/06/18(Tue) 15:08, Mark Kettenis wrote: > > > [...] > > > I think this is the wrong approach. Instead of modifying the struct > > > file, this code should create a new struct

Re: Prevent races w/ f_data

2018-06-19 Thread Mark Kettenis
> Date: Tue, 19 Jun 2018 15:45:48 +0200 > From: Martin Pieuchot > > On 19/06/18(Tue) 15:08, Mark Kettenis wrote: > > > Date: Tue, 19 Jun 2018 12:51:35 +0200 > > > From: Martin Pieuchot > > > > > > There's one place in our kernel where `f_data' is overwritten while the > > > descriptor sits in m

Re: Prevent races w/ f_data

2018-06-19 Thread Martin Pieuchot
On 19/06/18(Tue) 15:08, Mark Kettenis wrote: > > Date: Tue, 19 Jun 2018 12:51:35 +0200 > > From: Martin Pieuchot > > > > There's one place in our kernel where `f_data' is overwritten while the > > descriptor sits in multiple shared data structures. It is in diskmap. > > > > We want to avoid thi

Re: Prevent races w/ f_data

2018-06-19 Thread Mark Kettenis
> Date: Tue, 19 Jun 2018 12:51:35 +0200 > From: Martin Pieuchot > > There's one place in our kernel where `f_data' is overwritten while the > descriptor sits in multiple shared data structures. It is in diskmap. > > We want to avoid this situation to be able to treat f_data as immutable. > > S

Prevent races w/ f_data

2018-06-19 Thread Martin Pieuchot
There's one place in our kernel where `f_data' is overwritten while the descriptor sits in multiple shared data structures. It is in diskmap. We want to avoid this situation to be able to treat f_data as immutable. So the diff below remove `fp' from the shared data structures before it gets modi