Re: [PATCH] nfsd: Close a race between access checking/setting in nfs4_get_vfs_file

2016-06-12 Thread Jeff Layton
On Sat, 2016-06-11 at 23:15 -0400, Oleg Drokin wrote: > On Jun 11, 2016, at 10:50 PM, Jeff Layton wrote: > > > > > On Sat, 2016-06-11 at 22:06 -0400, Oleg Drokin wrote: > > > > > > > > > Hm. I am trying to lock the newly initialized one and that seems to be > > > holding up > > > well (but I w

Re: [PATCH] nfsd: Close a race between access checking/setting in nfs4_get_vfs_file

2016-06-11 Thread Oleg Drokin
On Jun 11, 2016, at 10:50 PM, Jeff Layton wrote: > On Sat, 2016-06-11 at 22:06 -0400, Oleg Drokin wrote: >> >> Hm. I am trying to lock the newly initialized one and that seems to be >> holding up >> well (but I want 24 hours just to be extra sure). >> Hn, I just noticed a bug in this, so that'l

Re: [PATCH] nfsd: Close a race between access checking/setting in nfs4_get_vfs_file

2016-06-11 Thread Jeff Layton
On Sat, 2016-06-11 at 22:06 -0400, Oleg Drokin wrote: > On Jun 11, 2016, at 9:33 PM, Jeff Layton wrote: > > > On Sat, 2016-06-11 at 11:41 -0400, Oleg Drokin wrote: > > > On Jun 10, 2016, at 4:55 PM, J . Bruce Fields wrote: > > > > > > > On Fri, Jun 10, 2016 at 06:50:33AM -0400, Jeff Layton wrote:

Re: [PATCH] nfsd: Close a race between access checking/setting in nfs4_get_vfs_file

2016-06-11 Thread Oleg Drokin
On Jun 11, 2016, at 9:33 PM, Jeff Layton wrote: > On Sat, 2016-06-11 at 11:41 -0400, Oleg Drokin wrote: >> On Jun 10, 2016, at 4:55 PM, J . Bruce Fields wrote: >> >>> On Fri, Jun 10, 2016 at 06:50:33AM -0400, Jeff Layton wrote: On Fri, 2016-06-10 at 00:18 -0400, Oleg Drokin wrote: > On

Re: [PATCH] nfsd: Close a race between access checking/setting in nfs4_get_vfs_file

2016-06-11 Thread Jeff Layton
On Sat, 2016-06-11 at 11:41 -0400, Oleg Drokin wrote: > On Jun 10, 2016, at 4:55 PM, J . Bruce Fields wrote: > > > On Fri, Jun 10, 2016 at 06:50:33AM -0400, Jeff Layton wrote: > > > On Fri, 2016-06-10 at 00:18 -0400, Oleg Drokin wrote: > > > > On Jun 9, 2016, at 5:01 PM, Oleg Drokin wrote: > > > >

Re: [PATCH] nfsd: Close a race between access checking/setting in nfs4_get_vfs_file

2016-06-11 Thread Oleg Drokin
On Jun 10, 2016, at 4:55 PM, J . Bruce Fields wrote: > On Fri, Jun 10, 2016 at 06:50:33AM -0400, Jeff Layton wrote: >> On Fri, 2016-06-10 at 00:18 -0400, Oleg Drokin wrote: >>> On Jun 9, 2016, at 5:01 PM, Oleg Drokin wrote: >>> Currently there's an unprotected access mode check in nfs4

Re: [PATCH] nfsd: Close a race between access checking/setting in nfs4_get_vfs_file

2016-06-10 Thread J . Bruce Fields
On Fri, Jun 10, 2016 at 06:50:33AM -0400, Jeff Layton wrote: > On Fri, 2016-06-10 at 00:18 -0400, Oleg Drokin wrote: > > On Jun 9, 2016, at 5:01 PM, Oleg Drokin wrote: > > > > > Currently there's an unprotected access mode check in > > > nfs4_upgrade_open > > > that then calls nfs4_get_vfs_file wh

Re: [PATCH] nfsd: Close a race between access checking/setting in nfs4_get_vfs_file

2016-06-10 Thread Jeff Layton
On Fri, 2016-06-10 at 00:18 -0400, Oleg Drokin wrote: > On Jun 9, 2016, at 5:01 PM, Oleg Drokin wrote: > > > Currently there's an unprotected access mode check in > > nfs4_upgrade_open > > that then calls nfs4_get_vfs_file which in turn assumes whatever > > access mode was present in the state is

Re: [PATCH] nfsd: Close a race between access checking/setting in nfs4_get_vfs_file

2016-06-09 Thread Oleg Drokin
On Jun 9, 2016, at 5:01 PM, Oleg Drokin wrote: > Currently there's an unprotected access mode check in nfs4_upgrade_open > that then calls nfs4_get_vfs_file which in turn assumes whatever > access mode was present in the state is still valid which is racy. > Two nfs4_get_vfs_file van enter the sa

[PATCH] nfsd: Close a race between access checking/setting in nfs4_get_vfs_file

2016-06-09 Thread Oleg Drokin
Currently there's an unprotected access mode check in nfs4_upgrade_open that then calls nfs4_get_vfs_file which in turn assumes whatever access mode was present in the state is still valid which is racy. Two nfs4_get_vfs_file van enter the same path as result and get two references to nfs4_file, bu