From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ve5i9-0003BM-7p for qemu-devel@nongnu.org; Wed, 06 Nov 2013 11:12:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ve5i0-0005JL-SH for qemu-devel@nongnu.org; Wed, 06 Nov 2013 11:12:05 -0500 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:45482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ve5i0-0005Gh-6m for qemu-devel@nongnu.org; Wed, 06 Nov 2013 11:11:56 -0500 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Nov 2013 21:41:52 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 49E3AE0053 for ; Wed, 6 Nov 2013 21:43:35 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rA6GBgCU22020326 for ; Wed, 6 Nov 2013 21:41:43 +0530 Received: from d28av05.in.ibm.com (localhost [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rA6GBlR6005077 for ; Wed, 6 Nov 2013 21:41:48 +0530 From: "Aneesh Kumar K.V" In-Reply-To: <1383558955-15033-1-git-send-email-kirill@shutemov.name> References: <1383558955-15033-1-git-send-email-kirill@shutemov.name> Date: Wed, 06 Nov 2013 21:41:47 +0530 Message-ID: <8761s5tsqk.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [RESEND] [PATCH] hw/9pfs: fix P9_STATS_GEN handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Kirill A. Shutemov" , qemu-devel@nongnu.org Cc: "Kirill A. Shutemov" , aliguori@amazon.com "Kirill A. Shutemov" writes: > From: "Kirill A. Shutemov" > > Currently we have few issues with P9_STATS_GEN: > > - We don't try to read st_gen anything except files or directories, but > still set P9_STATS_GEN bit in st_result_mask. It may mislead client: > we present garbage as valid st_gen. We should return 0 right ? We do memset(v9lstat, 0, sizeof(*v9lstat)); in stat_to_v9stat_dotl > > - If we failed to get valid st_gen with ENOTTY, we ignore error, but > still set P9_STATS_GEN bit in st_result_mask. and have v9lstat.st_gen set to zero > > - If we failed to get valid st_gen with any other errno, we fail > getattr altogether. It's excessive: we block valid client use-cases, > like chdir(2) to non-readable directory with execution bit set. > Can you explain this in detail ? > The patch fixes these issues and cleanup code a bit. > > Signed-off-by: Kirill A. Shutemov > Reviewed-by: Daniel P. Berrange > --- > hw/9pfs/cofile.c | 4 ---- > hw/9pfs/virtio-9p-handle.c | 8 +++++++- > hw/9pfs/virtio-9p-local.c | 10 ++++++---- > hw/9pfs/virtio-9p-proxy.c | 3 ++- > hw/9pfs/virtio-9p.c | 12 ++++++++++-- > 5 files changed, 25 insertions(+), 12 deletions(-) > -aneesh