From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfQx3-0004Bk-8b for qemu-devel@nongnu.org; Thu, 23 May 2013 04:32:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfQwy-0004bM-Jc for qemu-devel@nongnu.org; Thu, 23 May 2013 04:32:45 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:51028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfQpc-0002JH-Ep for qemu-devel@nongnu.org; Thu, 23 May 2013 04:25:05 -0400 Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 23 May 2013 18:11:52 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 09E0B2CE8053 for ; Thu, 23 May 2013 18:24:54 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4N8AZjG20906014 for ; Thu, 23 May 2013 18:10:35 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4N8OrIH030239 for ; Thu, 23 May 2013 18:24:53 +1000 From: "Aneesh Kumar K.V" In-Reply-To: <20130522145455.GG28600@stefanha-thinkpad.redhat.com> References: <1369221774-10735-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <20130522145455.GG28600@stefanha-thinkpad.redhat.com> Date: Thu, 23 May 2013 13:54:43 +0530 Message-ID: <87wqqq3xys.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] hw/9pfs: Use O_NOFOLLOW when opening files on server List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org Stefan Hajnoczi writes: > On Wed, May 22, 2013 at 04:52:54PM +0530, Aneesh Kumar K.V wrote: >> diff --git a/hw/9pfs/virtio-9p-handle.c b/hw/9pfs/virtio-9p-handle.c >> index fe8e0ed..e2a89e3 100644 >> --- a/hw/9pfs/virtio-9p-handle.c >> +++ b/hw/9pfs/virtio-9p-handle.c >> @@ -608,7 +608,7 @@ static int handle_init(FsContext *ctx) >> struct file_handle fh; >> struct handle_data *data = g_malloc(sizeof(struct handle_data)); >> >> - data->mountfd = open(ctx->fs_root, O_DIRECTORY); >> + data->mountfd = open(ctx->fs_root, O_DIRECTORY | O_NOFOLLOW); > > Why is the root path not allowed to be a symlink? No specific reason. > > And if so, it would be more user-friendly to resolve the path before > open. That way we don't need to bug the user with an error here. I will drop that hunk. -aneesh