From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110AbcGOC0L (ORCPT ); Thu, 14 Jul 2016 22:26:11 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:36956 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751476AbcGOC0I (ORCPT ); Thu, 14 Jul 2016 22:26:08 -0400 Date: Fri, 15 Jul 2016 03:26:03 +0100 From: Al Viro To: Liu Shuo Cc: Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Zhang Yanmin , He Bo , Liu Shuo , Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] KVM: release anon file in failure path of vm creation Message-ID: <20160715022603.GG14480@ZenIV.linux.org.uk> References: <1468316323-23835-1-git-send-email-shuo.a.liu@intel.com> <28049c2a-1b49-1909-52ce-105859e14e33@redhat.com> <20160714164647.GD14480@ZenIV.linux.org.uk> <20160715022204.GA16729@shuo-desktop.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160715022204.GA16729@shuo-desktop.sh.intel.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 15, 2016 at 10:22:04AM +0800, Liu Shuo wrote: > > You have no warranty whatsoever that descriptor table has not been changed > > by that point. You should *NEVER* use sys_close() on failure exit paths > Could you please elaborate why we're not sure descriptor table's changing at the point? Because that could be called by one thread while another (having guessed the descriptor you are about to get) does close()/dup2()/etc.