Re: [PATCH] fs/file.c: __fget() and dup2() atomicity rules

2015-06-29 Thread Eric Dumazet
On Mon, 2015-06-29 at 18:46 +0100, Al Viro wrote: > On Mon, Jun 29, 2015 at 05:10:30PM +0200, Eric Dumazet wrote: > > From: Eric Dumazet > > > > __fget() makes sure a file refcount is not zero before > > taking a reference. It should also fetch again file pointer > > in order to respect dup2() at

Re: [PATCH] fs/file.c: __fget() and dup2() atomicity rules

2015-06-29 Thread Al Viro
On Mon, Jun 29, 2015 at 05:10:30PM +0200, Eric Dumazet wrote: > From: Eric Dumazet > > __fget() makes sure a file refcount is not zero before > taking a reference. It should also fetch again file pointer > in order to respect dup2() atomicity requirements. > > It should either read a NULL pointe

[PATCH] fs/file.c: __fget() and dup2() atomicity rules

2015-06-29 Thread Eric Dumazet
From: Eric Dumazet __fget() makes sure a file refcount is not zero before taking a reference. It should also fetch again file pointer in order to respect dup2() atomicity requirements. It should either read a NULL pointer or a file on which a refcount can be taken. Dmitry had following test fai