[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RESEND] [PATCH] hw/9pfs: fix P9_STATS_GEN handling
From: |
Aneesh Kumar K.V |
Subject: |
Re: [Qemu-devel] [RESEND] [PATCH] hw/9pfs: fix P9_STATS_GEN handling |
Date: |
Wed, 06 Nov 2013 21:41:47 +0530 |
User-agent: |
Notmuch/0.16+99~g10596a5 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) |
"Kirill A. Shutemov" <address@hidden> writes:
> From: "Kirill A. Shutemov" <address@hidden>
>
> 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 <address@hidden>
> Reviewed-by: Daniel P. Berrange <address@hidden>
> ---
> 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