From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753163AbbF2Rq1 (ORCPT ); Mon, 29 Jun 2015 13:46:27 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:59170 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751343AbbF2RqT (ORCPT ); Mon, 29 Jun 2015 13:46:19 -0400 Date: Mon, 29 Jun 2015 18:46:16 +0100 From: Al Viro To: Eric Dumazet Cc: Andrew Morton , "linux-kernel@vger.kernel.org" , Dmitry Vyukov , Eric Dumazet , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] fs/file.c: __fget() and dup2() atomicity rules Message-ID: <20150629174616.GZ17109@ZenIV.linux.org.uk> References: <1435590630.4110.107.camel@edumazet-glaptop2.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435590630.4110.107.camel@edumazet-glaptop2.roam.corp.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 pointer or a file on which > a refcount can be taken. Hmm... The problem is real, but I wonder if one could trigger a long spin there...