From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTGYy-0001d0-4e for qemu-devel@nongnu.org; Wed, 04 Mar 2015 16:10:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTGYu-0001B7-Ea for qemu-devel@nongnu.org; Wed, 04 Mar 2015 16:10:39 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:50726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTGYu-0001B2-7s for qemu-devel@nongnu.org; Wed, 04 Mar 2015 16:10:36 -0500 Message-ID: <54F774CB.1040001@msgid.tls.msk.ru> Date: Thu, 05 Mar 2015 00:10:35 +0300 From: Michael Tokarev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] 9pfs-local: open2() deletes existing data? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Aneesh Kumar K.V" Cc: qemu-devel I was looking at various interesting functions in hw/9pfs/virtio-9p-local.c and noticed local_open2() which basically tries to open a file in a filesystem, and if that is successful, it tries to set file credentials using a configured mechanism, and if that fails, it deletes the file. Now I wonder what happens if we tried to open an existing file but was not able to set credentials for whatever reason -- eg, because the underlying filesystem does not support xattrs, or whatever. It looks to me that we will remove the user file! If that's the case, it looks like it is a very serious bug... Thanks, /mjt