Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-12-14 Thread Sakari Ailus
Hi Laurent, On Tue, Dec 12, 2017 at 04:42:23PM +0200, Laurent Pinchart wrote: ... > > > diff --git a/drivers/media/v4l2-core/v4l2-dev.c > > > b/drivers/media/v4l2-core/v4l2-dev.c index c647ba648805..c73c6d49e7cf > > > 100644 > > > --- a/drivers/media/v4l2-core/v4l2-dev.c > > > +++ b/drivers/media/

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-12-12 Thread Laurent Pinchart
Hi Mauro, On Tuesday, 12 December 2017 14:39:32 EET Mauro Carvalho Chehab wrote: > Em Thu, 23 Nov 2017 15:21:01 +0100 Greg Kroah-Hartman escreveu: > > On Thu, Nov 23, 2017 at 11:07:51AM -0200, Mauro Carvalho Chehab wrote: > >> Em Thu, 16 Nov 2017 02:33:48 +0200 Laurent Pinchart escreveu: > >>> Dev

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-12-12 Thread Laurent Pinchart
Hi Greg and Mauro, On Thursday, 23 November 2017 16:21:01 EET Greg Kroah-Hartman wrote: > On Thu, Nov 23, 2017 at 11:07:51AM -0200, Mauro Carvalho Chehab wrote: > > Em Thu, 16 Nov 2017 02:33:48 +0200 Laurent Pinchart escreveu: > >> Device unplug being asynchronous, it naturally races with operatio

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-12-12 Thread Laurent Pinchart
Hi Mauro, On Thursday, 23 November 2017 15:07:51 EET Mauro Carvalho Chehab wrote: > Em Thu, 16 Nov 2017 02:33:48 +0200 Laurent Pinchart escreveu: > > Device unplug being asynchronous, it naturally races with operations > > performed by userspace through ioctls or other file operations on video > >

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-12-12 Thread Laurent Pinchart
Hi Hans, On Friday, 17 November 2017 13:09:20 EET Hans Verkuil wrote: > On 16/11/17 01:33, Laurent Pinchart wrote: > > Device unplug being asynchronous, it naturally races with operations > > performed by userspace through ioctls or other file operations on video > > device nodes. > > > > This le

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-12-12 Thread Laurent Pinchart
Hi Kieran, On Thursday, 16 November 2017 16:47:11 EET Kieran Bingham wrote: > On 16/11/17 12:32, Sakari Ailus wrote: > > Hi Laurent, > > > > Thank you for the initiative to bring up and address the matter! > > I concur - this looks like a good start towards managing the issue. > > One potential

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-12-12 Thread Laurent Pinchart
Hi Sakari, On Thursday, 16 November 2017 14:32:37 EET Sakari Ailus wrote: > On Thu, Nov 16, 2017 at 02:33:48AM +0200, Laurent Pinchart wrote: > > Device unplug being asynchronous, it naturally races with operations > > performed by userspace through ioctls or other file operations on video > > dev

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-12-12 Thread Mauro Carvalho Chehab
Em Thu, 23 Nov 2017 15:21:01 +0100 Greg Kroah-Hartman escreveu: > On Thu, Nov 23, 2017 at 11:07:51AM -0200, Mauro Carvalho Chehab wrote: > > Hi Laurent, > > > > Em Thu, 16 Nov 2017 02:33:48 +0200 > > Laurent Pinchart escreveu: > > > > > Device unplug being asynchronous, it naturally races wi

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-11-23 Thread Greg Kroah-Hartman
On Thu, Nov 23, 2017 at 11:07:51AM -0200, Mauro Carvalho Chehab wrote: > Hi Laurent, > > Em Thu, 16 Nov 2017 02:33:48 +0200 > Laurent Pinchart escreveu: > > > Device unplug being asynchronous, it naturally races with operations > > performed by userspace through ioctls or other file operations o

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-11-23 Thread Mauro Carvalho Chehab
Hi Laurent, Em Thu, 16 Nov 2017 02:33:48 +0200 Laurent Pinchart escreveu: > Device unplug being asynchronous, it naturally races with operations > performed by userspace through ioctls or other file operations on video > device nodes. > > This leads to potential access to freed memory or to oth

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-11-17 Thread Hans Verkuil
Hi Laurent, On 16/11/17 01:33, Laurent Pinchart wrote: > Device unplug being asynchronous, it naturally races with operations > performed by userspace through ioctls or other file operations on video > device nodes. > > This leads to potential access to freed memory or to other resources > during

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-11-16 Thread Kieran Bingham
Hi Laurent, On 16/11/17 12:32, Sakari Ailus wrote: > Hi Laurent, > > Thank you for the initiative to bring up and address the matter! I concur - this looks like a good start towards managing the issue. One potential thing spotted on top of Sakari's review inline below, of course I suspect this

Re: [PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-11-16 Thread Sakari Ailus
Hi Laurent, Thank you for the initiative to bring up and address the matter! On Thu, Nov 16, 2017 at 02:33:48AM +0200, Laurent Pinchart wrote: > Device unplug being asynchronous, it naturally races with operations > performed by userspace through ioctls or other file operations on video > device

[PATCH/RFC 1/2] v4l: v4l2-dev: Add infrastructure to protect device unplug race

2017-11-15 Thread Laurent Pinchart
Device unplug being asynchronous, it naturally races with operations performed by userspace through ioctls or other file operations on video device nodes. This leads to potential access to freed memory or to other resources during device access if unplug occurs during device access. To solve this,